tkDNN icon indicating copy to clipboard operation
tkDNN copied to clipboard

Bounding box cross image border

Open lilong-epfl opened this issue 4 years ago • 2 comments

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?

lilong-epfl avatar Dec 26 '20 02:12 lilong-epfl

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.

mive93 avatar Jan 04 '21 15:01 mive93

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.

Fetulhak avatar Aug 05 '21 15:08 Fetulhak