ceccocats / tkDNN

Deep neural network library and toolkit to do high performace inference on NVIDIA jetson platforms
GNU General Public License v2.0
718 stars 209 forks source link

Bounding box cross image border #182

Open lilong-epfl opened 3 years ago

lilong-epfl commented 3 years ago

I noticed that sometimes the output bbox cross the image border. I run yolov4 coco model "yolo4_fp16_416_b4.rt". My video frame is 1920x1080, the output has the format <cl, xmin, ymin, xmax, ymax, prob> and get the following result: image

Another example: 62 1076.07 905.269 1432.92 1078.23 0.781482 0 1258.91 758.674 1764.24 1088.5 0.877903 0 269.656 904.954 839.898 1081.5 0.827466 0 -7.8483 761.261 171.499 1085.89 0.812028

Any ideas?

mive93 commented 3 years ago

It's probabily do to how the box is computed (https://github.com/ceccocats/tkDNN/blob/master/src/Yolo.cpp#L65) and the fact that there are no checks on the image bound. However, it shouldn't be a problem.

Fetulhak commented 3 years ago

I noticed that sometimes the output bbox cross the image border. I run yolov4 coco model "yolo4_fp16_416_b4.rt". My video frame is 1920x1080, the output has the format <cl, xmin, ymin, xmax, ymax, prob> and get the following result: image

Another example: 62 1076.07 905.269 1432.92 1078.23 0.781482 0 1258.91 758.674 1764.24 1088.5 0.877903 0 269.656 904.954 839.898 1081.5 0.827466 0 -7.8483 761.261 171.499 1085.89 0.812028

Any ideas?

Hi @lilong-epfl @mive93 @AlexeyAB I have got into the same problem is there any fix on the source code to solve this issue? I think the problem is when yolov4 predict the relative coordinates it did not check whether it is out of image border IDK?

[0.00623968 0.77162105 0.01684078 0.01875179 0. 0.08409741] this is an output prediction for my input image of size 832. when I did the calculations on the extended version of the original image center_X becomes around 5.19 while the width of the bbox is around 14.01 which will be out of the image border.