diff options
author | Guo, Yejun <yejun.guo@intel.com> | 2021-03-16 13:02:56 +0800 |
---|---|---|
committer | Guo, Yejun <yejun.guo@intel.com> | 2021-05-06 10:50:44 +0800 |
commit | fc26dca64e0e5d20bb0fcc8743d073cf5b107264 (patch) | |
tree | ba5a30a5c1cbb922c8f8c3ba9b10ad22f86ccf95 /libavfilter/dnn_interface.h | |
parent | a3b74651a0408ddb19c2f0334ad4ad3f368376a6 (diff) | |
download | ffmpeg-fc26dca64e0e5d20bb0fcc8743d073cf5b107264.tar.gz |
lavfi/dnn: add classify support with openvino backend
Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Diffstat (limited to 'libavfilter/dnn_interface.h')
-rw-r--r-- | libavfilter/dnn_interface.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libavfilter/dnn_interface.h b/libavfilter/dnn_interface.h index 941670675d..799244ee14 100644 --- a/libavfilter/dnn_interface.h +++ b/libavfilter/dnn_interface.h @@ -52,7 +52,7 @@ typedef enum { DFT_NONE, DFT_PROCESS_FRAME, // process the whole frame DFT_ANALYTICS_DETECT, // detect from the whole frame - // we can add more such as detect_from_crop, classify_from_bbox, etc. + DFT_ANALYTICS_CLASSIFY, // classify for each bounding box }DNNFunctionType; typedef struct DNNData{ @@ -71,8 +71,14 @@ typedef struct DNNExecBaseParams { AVFrame *out_frame; } DNNExecBaseParams; +typedef struct DNNExecClassificationParams { + DNNExecBaseParams base; + const char *target; +} DNNExecClassificationParams; + typedef int (*FramePrePostProc)(AVFrame *frame, DNNData *model, AVFilterContext *filter_ctx); typedef int (*DetectPostProc)(AVFrame *frame, DNNData *output, uint32_t nb, AVFilterContext *filter_ctx); +typedef int (*ClassifyPostProc)(AVFrame *frame, DNNData *output, uint32_t bbox_index, AVFilterContext *filter_ctx); typedef struct DNNModel{ // Stores model that can be different for different backends. @@ -97,6 +103,8 @@ typedef struct DNNModel{ FramePrePostProc frame_post_proc; // set the post process to interpret detect result from DNNData DetectPostProc detect_post_proc; + // set the post process to interpret classify result from DNNData + ClassifyPostProc classify_post_proc; } DNNModel; // Stores pointers to functions for loading, executing, freeing DNN models for one of the backends. |