Open wishforgood opened 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])
Here are my codes to count the objects.
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.
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.