diff options
author | Guo, Yejun <yejun.guo@intel.com> | 2019-04-25 10:14:33 +0800 |
---|---|---|
committer | Pedro Arthur <bygrandao@gmail.com> | 2019-05-08 12:33:00 -0300 |
commit | 25c1cd909fa6c8b6b778dc24192dc3ec780324b0 (patch) | |
tree | b428c01522b2935d0b6af414580edcdf39370093 /libavfilter/dnn_interface.h | |
parent | 7adfb6132e0823de06f92ecbcb485eeb4260d407 (diff) |
libavfilter/dnn: support multiple outputs for tensorflow model
some models such as ssd, yolo have more than one output.
the clean up code in this patch is a little complex, it is because
that set_input_output_tf could be called for many times together
with ff_dnn_execute_model_tf, we have to clean resources for the
case that the two interfaces are called interleaved.
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.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavfilter/dnn_interface.h b/libavfilter/dnn_interface.h index 822f6e5b68..73d226ec91 100644 --- a/libavfilter/dnn_interface.h +++ b/libavfilter/dnn_interface.h @@ -26,6 +26,8 @@ #ifndef AVFILTER_DNN_INTERFACE_H #define AVFILTER_DNN_INTERFACE_H +#include <stdint.h> + typedef enum {DNN_SUCCESS, DNN_ERROR} DNNReturnType; typedef enum {DNN_NATIVE, DNN_TF} DNNBackendType; @@ -40,7 +42,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, 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. @@ -48,7 +50,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; |