SOON icon indicating copy to clipboard operation
SOON copied to clipboard

Bboxes do not contain center point

Open guhur opened this issue 3 years ago • 2 comments

Hi,

The SOON dataset is offering bboxes defined as polygons of (heading, elevation) points. A predicted point is considered as valid if it belongs to its related polygon.

However, it seems that the polygons do not always contain the ground truth points.

The following code provides a success rate of 55.8% :

import json
data = json.load(open('data/task/SOON_train.json'))
total = 0
success = 0
for soon_item in data:
    for bbox in soon_item['bboxes']:
        t =  bbox['target']
        polygon = Polygon([
            [t['left_top']['heading']/ (2 * math.pi), (t['left_top']['elevation']+math.pi)/ (2 * math.pi)],
            [t['right_top']['heading']/ (2 * math.pi), (t['right_top']['elevation']+math.pi)/ (2 * math.pi)],
            [t['right_bottom']['heading']/ (2 * math.pi), (t['right_bottom']['elevation']+math.pi)/ (2 * math.pi)],
            [t['left_bottom']['heading']/ (2 * math.pi), (t['left_bottom']['elevation']+math.pi)/ (2 * math.pi)],    
        ])
        p = Point(
            t['center']['heading']/ (2 * math.pi), 
            (t['center']['elevation']+math.pi)/ (2 * math.pi)
        )
        success += int(polygon.contains(p))
        total += 1
print(success /total)

I am using the normalization as described here: https://github.com/ZhuFengdaaa/SOON/blob/master/r2r_src/utils.py#L156

guhur avatar Sep 24 '21 11:09 guhur