danfeiX / scene-graph-TF-release

"Scene Graph Generation by Iterative Message Passing" code repository
http://cs.stanford.edu/~danfei/scene-graph/
MIT License
425 stars 130 forks source link

How and where are the frequent objects and relationships selected? #42

Open wishforgood opened 5 years ago

wishforgood commented 5 years ago

I wonder from which version of Visual Genome are the frequent objects and relationships selected. Because I counted the occurrences myself but got totally different results as in VG-SGG-dicts.json. For example, for object 'man', I got 88886 instances from Visual Genome V1.0, rather than 54659. I tried all the three versions of the dataset, but fail to get a same result with VG-SGG-dicts.json.

wishforgood commented 5 years ago
import json
import os
from collections import Counter

work_dir = 'C:/Users/Admin/Downloads'
object_list = open('object_list.txt', 'r')
object_list = object_list.readlines()
for idx, line in enumerate(object_list):
    object_list[idx] = object_list[idx].strip('\n')
name_counter = Counter()
with open(os.path.join(work_dir, 'objects_v1.json/objects.json')) as f:
    objects = json.load(f)
for image in objects:
    for object_ in image['objects']:
        for name in object_['names']:
            if name in object_list:
                name_counter.update([name])
wishforgood commented 5 years ago

Here are my codes to count the objects.

L6-hong commented 4 years ago

Can you generate proposals.h5 corresponding to the small data set? Please tell me how to generate it if you can. Thank you very much.