summaryrefslogtreecommitdiff
path: root/libavfilter/dnn_interface.h
diff options
context:
space:
mode:
authorGuo, Yejun <yejun.guo@intel.com>2019-04-25 10:14:42 +0800
committerPedro Arthur <bygrandao@gmail.com>2019-05-08 12:33:00 -0300
commitc636dc9819ebab1a84237cc017a6a3d35ebc9cdc (patch)
tree39fd943e649cb1185f25ccce6e7be193448ba23c /libavfilter/dnn_interface.h
parent25c1cd909fa6c8b6b778dc24192dc3ec780324b0 (diff)
libavfilter/dnn: add more data type support for dnn model input
currently, only float is supported as model input, actually, there are other data types, this patch adds uint8. Signed-off-by: Guo, Yejun <yejun.guo@intel.com> Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
Diffstat (limited to 'libavfilter/dnn_interface.h')
-rw-r--r--libavfilter/dnn_interface.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/libavfilter/dnn_interface.h b/libavfilter/dnn_interface.h
index 73d226ec91..c24df0e961 100644
--- a/libavfilter/dnn_interface.h
+++ b/libavfilter/dnn_interface.h
@@ -32,6 +32,14 @@ typedef enum {DNN_SUCCESS, DNN_ERROR} DNNReturnType;
typedef enum {DNN_NATIVE, DNN_TF} DNNBackendType;
+typedef enum {DNN_FLOAT, DNN_UINT8} DNNDataType;
+
+typedef struct DNNInputData{
+ void *data;
+ DNNDataType dt;
+ int width, height, channels;
+} DNNInputData;
+
typedef struct DNNData{
float *data;
int width, height, channels;
@@ -42,7 +50,7 @@ typedef struct DNNModel{
void *model;
// Sets model input and output.
// Should be called at least once before model execution.
- DNNReturnType (*set_input_output)(void *model, DNNData *input, const char *input_name, const char **output_names, uint32_t nb_output);
+ DNNReturnType (*set_input_output)(void *model, DNNInputData *input, const char *input_name, const char **output_names, uint32_t nb_output);
} DNNModel;
// Stores pointers to functions for loading, executing, freeing DNN models for one of the backends.