1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-19 05:49:09 +02:00
FFmpeg/libavfilter
Guo, Yejun aa9ffdaa1e lavfi: 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-toolkit/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_tools/inference_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:input=data:output=detection_out:confidence=0.6:labels=face-detection-adas-0001.label,showinfo -f null -

We'll see the detect result as below:
[Parsed_showinfo_1 @ 0x560c21ecbe40]   side data - detection bounding boxes:
[Parsed_showinfo_1 @ 0x560c21ecbe40] source: face-detection-adas-0001.xml
[Parsed_showinfo_1 @ 0x560c21ecbe40] index: 0,  region: (1005, 813) -> (1086, 905), label: face, confidence: 10000/10000.
[Parsed_showinfo_1 @ 0x560c21ecbe40] 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@intel.com>
2021-04-17 17:27:02 +08:00
..
2020-02-14 09:59:27 +01:00
2019-10-01 14:55:43 +02:00
2021-01-01 15:25:48 +01:00
2021-03-01 06:10:44 +01:00
2019-05-14 15:17:14 +02:00
2019-12-10 16:09:14 +01:00
2020-03-17 22:46:36 +01:00
2021-01-17 12:06:01 +01:00
2021-01-17 12:06:01 +01:00
2020-02-14 21:49:47 +01:00
2021-04-11 23:18:20 +08:00
2021-04-11 23:18:20 +08:00
2019-10-23 12:37:46 +02:00
2019-09-30 16:39:39 +02:00
2020-02-04 18:28:04 +01:00
2020-02-29 22:31:01 +01:00
2021-02-07 11:48:28 +01:00
2021-02-18 09:59:37 +08:00
2021-01-25 00:48:35 +01:00
2019-09-26 08:10:31 +08:00
2020-03-17 22:46:36 +01:00
2021-01-01 15:25:48 +01:00
2021-03-06 12:42:16 +01:00
2021-02-11 00:45:08 +01:00
2020-03-17 22:46:36 +01:00
2021-02-08 11:06:29 +01:00
2021-01-26 12:19:09 +01:00
2021-02-18 09:59:37 +08:00
2020-05-23 15:52:27 +02:00
2021-04-11 23:18:20 +08:00
2021-02-16 22:26:56 +01:00
2021-03-01 06:10:44 +01:00
2020-03-17 22:46:36 +01:00