Weighted-Boxes-Fusion icon indicating copy to clipboard operation
Weighted-Boxes-Fusion copied to clipboard

Why is coordinates for boxes expected to be normalized e.g in range [0; 1]?

Open Dragonsson opened this issue 4 years ago • 5 comments

Can it exceed the limit?Whether the limit has mathematical meaning? I use WBF,but got worse results.So I wonder if that's the reason

Dragonsson avatar Mar 27 '20 08:03 Dragonsson

I also have this question, do you find the problem?

Linamiao-1998 avatar Mar 09 '21 02:03 Linamiao-1998

If any coordinate goes below 0 or higher than 1 it will be trimmed to 0 or 1 respectively. It's in the code here: https://github.com/ZFTurbo/Weighted-Boxes-Fusion/blob/master/ensemble_boxes/ensemble_boxes_wbf.py#L56

ZFTurbo avatar Mar 09 '21 07:03 ZFTurbo

how to normalize? the box coordinate is (x1, y1, x2, y2) which represents the left-top and right-bottom corner, and the image's height is h, image's width is w. the normalized coordinates is (x1/w, y1/h, x2/w, y2/h)?

SISTMrL avatar May 25 '21 01:05 SISTMrL

how to normalize? the box coordinate is (x1, y1, x2, y2) which represents the left-top and right-bottom corner, and the image's height is h, image's width is w. the normalized coordinates is (x1/w, y1/h, x2/w, y2/h)?

Yes, that's right.

ZFTurbo avatar May 25 '21 06:05 ZFTurbo

how to normalize? the box coordinate is (x1, y1, x2, y2) which represents the left-top and right-bottom corner, and the image's height is h, image's width is w. the normalized coordinates is (x1/w, y1/h, x2/w, y2/h)?

Yes, that's right.

Hi, I also have the same problem, I understand how to normalize the box coordinates. However, Weighted-Boxes fusion need to calculate the IoU for each pair of bounding boxes. It means we need image height and width to convert them to box coordinates with Pascal Voc (without normalized). In function below, it does not require image height and width.

boxes, scores, labels = weighted_boxes_fusion(boxes_list, scores_list, labels_list, weights=weights, iou_thr=iou_thr, skip_box_thr=skip_box_thr)

Please help me explain it. Thank you.

nmnguyensg avatar Aug 29 '23 04:08 nmnguyensg