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>
This commit is contained in:
parent
25c1cd909f
commit
c636dc9819
4 changed files with 39 additions and 7 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue