mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-11-02 13:24:20 +08:00
avfilter/dnn: get the data type of network output from dnn execution result
so, we can make a filter more general to accept different network models, by adding a data type convertion after getting data from network. After we add dt field into struct DNNData, it becomes the same as DNNInputData, so merge them with one struct: DNNData. Signed-off-by: Guo, Yejun <yejun.guo@intel.com> Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
This commit is contained in:
@@ -34,15 +34,10 @@ typedef enum {DNN_NATIVE, DNN_TF} DNNBackendType;
|
||||
|
||||
typedef enum {DNN_FLOAT = 1, DNN_UINT8 = 4} DNNDataType;
|
||||
|
||||
typedef struct DNNInputData{
|
||||
typedef struct DNNData{
|
||||
void *data;
|
||||
DNNDataType dt;
|
||||
int width, height, channels;
|
||||
} DNNInputData;
|
||||
|
||||
typedef struct DNNData{
|
||||
float *data;
|
||||
int width, height, channels;
|
||||
} DNNData;
|
||||
|
||||
typedef struct DNNModel{
|
||||
@@ -50,7 +45,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, DNNInputData *input, const char *input_name, const char **output_names, uint32_t nb_output);
|
||||
DNNReturnType (*set_input_output)(void *model, DNNData *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.
|
||||
|
||||
Reference in New Issue
Block a user