[decoder] Add boundingbox decoder for yolov8
authorYongjoo Ahn <yongjoo1.ahn@samsung.com>
Tue, 22 Aug 2023 04:20:51 +0000 (13:20 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 23 Aug 2023 05:19:33 +0000 (14:19 +0900)
commitdabaadc553766beff030d13d393aec0477a1dba0
treececa47ae11040780447fd1782dcb34bbeec9f51a
parent9b1b0a0ddc1d6239e0787c6831577c8384e80741
[decoder] Add boundingbox decoder for yolov8

- Add boundingbox decoder for yolov8
TODO: refactor yolov5 and yolov8 which are sharing many common parts

Tested simple pipeline:
```
gst-launch-1.0 \
v4l2src ! videoscale ! videoconvert ! video/x-raw,width=320,height=320,format=RGB,framerate=30/1,pixel-aspect-ratio=1/1 ! tee name=t \
t. ! queue ! tensor_converter ! other/tensors,num_tensors=1,types=uint8,format=static,dimensions=3:320:320:1 ! \
  tensor_transform mode=arithmetic option=typecast:float32,add:0.0,div:255.0 ! \
  queue leaky=2 max-size-buffers=2 ! \
  tensor_filter framework=tensorflow2-lite model=~/ultralytics/yolov8s_saved_model/yolov8s_float16.tflite custom=Delegate:XNNPACK,NumThreads:4 latency=1 ! \
  other/tensors,num_tensors=1,types=float32,format=static,dimensions=2100:84:1 ! \
  tensor_transform mode=transpose option=1:0:2:3 ! \
  tensor_decoder mode=bounding_boxes option1=yolov8 option2=./coco-80.txt option3=0 option4=320:320 option5=320:320 ! \
  video/x-raw,width=320,height=320,format=RGBA ! mix.sink_0 \
t. ! queue ! mix.sink_1 compositor name=mix sink_0::zorder=2 sink_1::zorder=1 ! videoconvert ! autovideosink
```
Note that the used model file yolov8s_float16.tflite is created by official guide of yolov8 project.

REF: https://github.com/ultralytics/ultralytics

Signed-off-by: Yongjoo Ahn <yongjoo1.ahn@samsung.com>
ext/nnstreamer/tensor_decoder/tensordec-boundingbox.c