[FFmpeg-devel] [PATCH V3 3/3] libavfilter: add filter dnn_detect for object detection

Guo, Yejun yejun.guo at intel.com
Mon Mar 1 02:26:38 EET 2021



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of Guo,
> Yejun
> Sent: 2021年2月25日 10:02
> To: ffmpeg-devel at ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH V3 3/3] libavfilter: add filter dnn_detect
> for object detection
> 
> 
> 
> > -----Original Message-----
> > From: Guo, Yejun <yejun.guo at intel.com>
> > Sent: 2021年2月22日 15:31
> > To: ffmpeg-devel at ffmpeg.org
> > Cc: Guo, Yejun <yejun.guo at intel.com>
> > Subject: [PATCH V3 3/3] libavfilter: add filter dnn_detect for object
> > detection
> >
> > Below are the example steps to do object detection:
> >
> > 1. download and install l_openvino_toolkit_p_2021.1.110.tgz from
> > https://software.intel.com/content/www/us/en/develop/tools/openvino-to
> > olk
> > it/download.html
> >   or, we can get source code (tag 2021.1), build and install.
> > 2. export LD_LIBRARY_PATH with openvino settings, for example:
> > .../deployment_tools/inference_engine/lib/intel64/:.../deployment_tool
> > s/infer
> > ence_engine/external/tbb/lib/
> > 3. rebuild ffmpeg from source code with configure option:
> > --enable-libopenvino
> > --extra-cflags='-I.../deployment_tools/inference_engine/include/'
> > --extra-ldflags='-L.../deployment_tools/inference_engine/lib/intel64'
> > 4. download model files and test image wget
> >
> https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/2021.
> > 1/face-detection-adas-0001.bin
> > wget
> >
> https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/2021.
> > 1/face-detection-adas-0001.xml
> > wget
> >
> https://github.com/guoyejun/ffmpeg_dnn/raw/main/models/openvino/2021.
> > 1/face-detection-adas-0001.label
> > wget https://github.com/guoyejun/ffmpeg_dnn/raw/main/images/cici.jpg
> > 5. run ffmpeg with:
> > ./ffmpeg -i cici.jpg -vf
> >
> dnn_detect=dnn_backend=openvino:model=face-detection-adas-0001.xml:inp
> > ut=data:output=detection_out:confidence=0.6:labels=face-detection-adas
> > -000
> > 1.label -f null -
> >
> > We'll see the detect result as below:
> > [Parsed_dnn_detect_0 @ 0x56226644e540] frame->private_ref (bounding
> > boxes):
> > [Parsed_dnn_detect_0 @ 0x56226644e540] source:
> > face-detection-adas-0001.xml
> > [Parsed_dnn_detect_0 @ 0x56226644e540] index: 0, region: (1005, 813)
> > -> (1086, 905), label: face, confidence: 10000/10000.
> > [Parsed_dnn_detect_0 @ 0x56226644e540] index: 1, region: (888, 839) ->
> > (967, 926), label: face, confidence: 6917/10000.
> >
> > There are two faces detected with confidence 100% and 69.17%.
> >
> > Signed-off-by: Guo, Yejun <yejun.guo at intel.com>
> > ---
> >  configure                              |   1 +
> >  doc/filters.texi                       |  40 +++
> >  libavfilter/Makefile                   |   1 +
> >  libavfilter/allfilters.c               |   1 +
> >  libavfilter/dnn/dnn_backend_openvino.c |  12 +
> >  libavfilter/dnn_filter_common.c        |   7 +
> >  libavfilter/dnn_filter_common.h        |   1 +
> >  libavfilter/dnn_interface.h            |   6 +-
> >  libavfilter/vf_dnn_detect.c            | 462
> > +++++++++++++++++++++++++
> >  9 files changed, 529 insertions(+), 2 deletions(-)  create mode
> > 100644 libavfilter/vf_dnn_detect.c
> >
> 
> any other comment for this patch set? thanks.

will push tomorrow if no other objections, thanks.


More information about the ffmpeg-devel mailing list