onnxruntime/onnxruntime/python/tools/featurizer_ops
Ashwini Khade b22e60bd44
pull onnx latest commit (#7102)
* update onnx commit

* fix test scripts to remove deprecated call

* update filters

* add registration for relu and cumsum ver 14

* add promote trilu to onnx domain

* update onnx-tensorrt submodule

* update flag

* update flag

* update dependencies

* fix android ci failure
2021-03-29 11:00:38 -07:00
..
create_test_model.py pull onnx latest commit (#7102) 2021-03-29 11:00:38 -07:00
data_frame_tool.py Update data_frame_tool to latest (#3919) 2020-05-18 21:13:56 -07:00
data_frame_tool_test.py Use yapf to format python (#3276) 2020-03-20 14:34:10 -07:00
README.md Package data_frame_tool, include featurizers into Manilinux2010 (#2989) 2020-02-07 11:38:42 -08:00

DataFrameTool overview

This tool helps to feed data from an an instance of pandas DataFrame to a loaded ONNX model using ONNX Runtime API.

Example of usage

See example of usage in feed_inputs_test.py in the same directory.

import onnxruntime as onnxrt
import numpy as np
import pandas as pd

from feed_inputs import DataFrameTool

# Load the onnx model
sess_options = onnxrt.SessionOptions()
sess_options.enable_profiling = args.profile

df_tool = DataFrameTool(args.model_path, sess_options)

# Create a DataFrame that holds 3 inputs, string, bool, float in their respective columns
df = pd.DataFrame([['string_input', 3.25, 8, 16, 32, 64, True, 0.25]], 
                  columns=['StringInput', 'DoubleInput', 'Int8Input', 'Int16Input', 'Int32Input', 'Int64Input', 'BoolInput', 'Float32Input'])

outputs = df_tool.execute(df, [])
print('Outputs: ', outputs)