jkjung-avt / tensorrt_demos

TensorRT MODNet, YOLOv4, YOLOv3, SSD, MTCNN, and GoogLeNet
https://jkjung-avt.github.io/
MIT License
1.75k stars 547 forks source link

Question: bbox coordinates #560

Closed Terizian closed 2 years ago

Terizian commented 2 years ago

I have a question with regards to the updates done on this repository. I have used this repo 2 years ago and I believe that the coordinates of the bounding boxes were formatted as x, y, w, h (just like the darknet annotations format). Has this changed to xmin, ymin, xmax, ymax?

jkjung-avt commented 2 years ago

The bbox outputs of the TensorRT YOLO engines are [x, y, w, h] (all values ranging between 0 and 1).

The _postprocess_yolo() function will take those values and output [xmin, ymin, xmax, ymax] (real coordinates). The source code is here:

https://github.com/jkjung-avt/tensorrt_demos/blob/a061e44a82e1ca097f57e5a32f20daf5bebe7ade/utils/yolo_with_plugins.py#L158

Terizian commented 2 years ago

Oh that makes a lot of sense! Thank you so much for the clarification and thank you as always for the prompt replies.