Open uehara-mech opened 3 years ago
I thought the key in the tsv file (
visualgenome/label_danfeiX_overlap.new.tsv
) represented the image ID, but I found out that it does not.from maskrcnn_benchmark.structures.tsv_file_ops import tsv_reader import glob # get image ids from Visual Genome image files img_files = glob.glob('/VisualGenome/VG_100K/*.jpg') + glob.glob('/VisualGenome/VG_100K_2/*.jpg') image_ids_from_files = [img_file.split('/')[-1].split('.')[0] for img_file in img_files] # get image ids from the scene graph annotation files tsv = tsv_reader('datasets/visualgenome/label_danfeiX_overlap.new.tsv') image_ids_from_annos = [row[0] for row in tsv] # extract the overlap between the two data overlap = set(image_ids_from_annos) & set(image_ids_from_files) print(f'size of iid from files: {len(image_ids_from_files)}') print(f'size of iid from annotations: {len(image_ids_from_annos)}') print(f'size of overlapped iid: {len(overlapped_iid)}')
The output of this code looks like this:
size of iid from files: 108249 size of iid from annotations: 108073 size of overlapped iid: 5196
I think this shows that about 95% of the image ids are mismatched. How can I get the correct image id mapping?
Same problem, do you find the image id mapping now?
No, I didn't find the image id mapping.
Finally, I ended up comparing all the image arrays in Visual Genome dataset and img.tsv
one by one, looking for the same image (this is incredibly cumbersome, but I couldn't think of any other way...)
No, I didn't find the image id mapping. Finally, I ended up comparing all the image arrays in Visual Genome dataset and
img.tsv
one by one, looking for the same image (this is incredibly cumbersome, but I couldn't think of any other way...)
Thank you. I usedimg.tsv
to build a id mapping and verified it. It is indeed one-to-one correspondence.
No, I didn't find the image id mapping. Finally, I ended up comparing all the image arrays in Visual Genome dataset and
img.tsv
one by one, looking for the same image (this is incredibly cumbersome, but I couldn't think of any other way...)Thank you. I used
img.tsv
to build a id mapping and verified it. It is indeed one-to-one correspondence.
I tried to encode the image and find the correspondence mapping. But I can not map the hashcode in img.tsv with the hashcodes I built with Visualgenome images. May you share the code you build the mapping? Thank you for the help.
You can use a script like this: https://gist.github.com/uehara-mech/f4c850999f1c90f61851951e1183ef0a (you may need to modify the code to make it work in your environment)
I thought the key in the tsv file (
visualgenome/label_danfeiX_overlap.new.tsv
) represented the image ID, but I found out that it does not.The output of this code looks like this:
I think this shows that about 95% of the image ids are mismatched. How can I get the correct image id mapping?