X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavfilter%2Fdnn_interface.h;h=057005f47e7294d779c2d4716400063b51bd5d0f;hb=45bb80dccc558a38a3539496575694995b38ff64;hp=822f6e5b68a4ed670d38aae4eaafecf0504ac8dd;hpb=e2b92896c4ca609c851ea8c1a1bfd5d0918a5269;p=ffmpeg diff --git a/libavfilter/dnn_interface.h b/libavfilter/dnn_interface.h index 822f6e5b68a..057005f47e7 100644 --- a/libavfilter/dnn_interface.h +++ b/libavfilter/dnn_interface.h @@ -26,10 +26,20 @@ #ifndef AVFILTER_DNN_INTERFACE_H #define AVFILTER_DNN_INTERFACE_H +#include + typedef enum {DNN_SUCCESS, DNN_ERROR} DNNReturnType; typedef enum {DNN_NATIVE, DNN_TF} DNNBackendType; +typedef enum {DNN_FLOAT = 1, DNN_UINT8 = 4} DNNDataType; + +typedef struct DNNInputData{ + void *data; + DNNDataType dt; + int width, height, channels; +} DNNInputData; + typedef struct DNNData{ float *data; int width, height, channels; @@ -40,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_name); + 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. @@ -48,7 +58,7 @@ typedef struct DNNModule{ // Loads model and parameters from given file. Returns NULL if it is not possible. DNNModel *(*load_model)(const char *model_filename); // Executes model with specified input and output. Returns DNN_ERROR otherwise. - DNNReturnType (*execute_model)(const DNNModel *model, DNNData *output); + DNNReturnType (*execute_model)(const DNNModel *model, DNNData *outputs, uint32_t nb_output); // Frees memory allocated for model. void (*free_model)(DNNModel **model); } DNNModule;