google / sg2im

Code for "Image Generation from Scene Graphs", Johnson et al, CVPR 2018
Apache License 2.0
1.29k stars 231 forks source link

A better way to calculate object area #7

Open jamiechoi1995 opened 5 years ago

jamiechoi1995 commented 5 years ago

According to your paper, objects that smaller than 2% will be ignored. https://github.com/google/sg2im/blob/26383737500a2855e772637a222bb0a871034f0d/sg2im/data/coco.py#L152 but this code only consider the width and height, and this could not reflect the true area of an object,

For example, this is a "clothes" stuff, and most of the area is blank. (Original image: http://cocodataset.org/#explore?id=245764) clothes

the area calculated by w and h is 10692, but if you use codes like `np.sum(mask)', you get a more accurate area of 1115.