- // Sets model input and output, while allocating additional memory for intermediate calculations.
- // Should be called at least once before model execution.
- DNNReturnType (*set_input_output)(void *model, DNNData *input, DNNData *output);
+ // Stores options when the model is executed by the backend
+ const char *options;
+ // Stores FilterContext used for the interaction between AVFrame and DNNData
+ AVFilterContext *filter_ctx;
+ // Stores function type of the model
+ DNNFunctionType func_type;
+ // Gets model input information
+ // Just reuse struct DNNData here, actually the DNNData.data field is not needed.
+ DNNReturnType (*get_input)(void *model, DNNData *input, const char *input_name);
+ // Gets model output width/height with given input w/h
+ DNNReturnType (*get_output)(void *model, const char *input_name, int input_width, int input_height,
+ const char *output_name, int *output_width, int *output_height);
+ // set the pre process to transfer data from AVFrame to DNNData
+ // the default implementation within DNN is used if it is not provided by the filter
+ FramePrePostProc frame_pre_proc;
+ // set the post process to transfer data from DNNData to AVFrame
+ // the default implementation within DNN is used if it is not provided by the filter
+ FramePrePostProc frame_post_proc;
+ // set the post process to interpret detect result from DNNData
+ DetectPostProc detect_post_proc;