yijingru / BBAVectors-Oriented-Object-Detection

[WACV2021] Oriented Object Detection in Aerial Images with Box Boundary-Aware Vectors
MIT License
462 stars 87 forks source link

Question about the code in function "data_transform" #69

Open seekFire opened 3 years ago

seekFire commented 3 years ago

I read the code of these line in datasets/base.py, I will use the illustration shown below to describe my question: question

I think the code under the first if statement is used for addressing the case of coordinates overflow like the situation shown in Figure.1.(the x-coord of point c is larger than image width). After running the code in line 93~94, the point c will be replaced by the new point c', shown in Figure.2. So the ground truth bbox will compose of new four points(a, b, c' and d) rather than (a, b, c, d), which is shown in Figure.3. Under this situation, the minimum enclosing rectangle of this bbox may either be the same with original bbox(solid green line), or be another coordinates-overflowed box(blue dot line), shown in Figure.4. In short, there may also exists the case of coordinates overflow.

yijingru commented 3 years ago

Good point. I did this correction because if the coordinates overflow, it would be hard for the network to measure the correct t, r, b, l vector when the center is not changed (t!=b, l!=r) or the center position will not be correctly captured. To reduce errors, I made a constraint iou>0.6. But it should have a tradeoff.