This example shows how to use a BLOB column as input to ONNXPredict.
The model tf_iris_softmax_onetensor_model expects an input array of four float32 values. The input is named float_input.
Instead of mapping four float columns to this input, you can provide a precomputed input array. If your table contains a float_input column as a BLOB, you can use this column directly as input to the model.
This approach uses binary input and does not require column-to-array mapping.
select * from mldb.ONNXPredict(
on (select id, float_input from iris_test_binary)
on (select * from onnx_models where model_id='tf_iris_softmax_onetensor_model') DIMENSION
using
Accumulate('id')
) as td
order by 1
;
*** Query completed. 30 rows found. 2 columns returned.
*** Total elapsed time was 1 second.
id json_report
----------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
15 {"probability":[[0.9999999,1.7266593E-7,1.2621994E-13]]}
70 {"probability":[[3.5515524E-5,0.9994023,5.6225434E-4]]}
130 {"probability":[[2.5531106E-8,0.9915138,0.008486271]]}
...