VR-data / RAHP /RAHP_file /tmp.py
MengHsir's picture
Upload folder using huggingface_hub
89bd02d verified
import json
import torch
json_path='./SGG_data/RAHP/RAHP_file/vg_relation_aware_prompts.json'
json_file = json.load(open(json_path))
print(len(json_file.keys())) # 45000=30*30*50
super_entities = [
'male', 'female', 'children', 'pets', 'wild animal', 'ground transport',
'water transport', 'air transport', 'sports equipment', 'seating furniture',
'decorative item', 'table', 'upper body clothing', 'lower body clothing',
'footwear', 'accessory', 'fruit', 'vegetable', 'prepared food', 'beverage',
'utensils', 'container', 'textile', 'landscape', 'urban feature', 'plant',
'structure', 'household item', 'head part', 'limb and appendage'
]
print(len(super_entities)) # 30
# with open('./RAHP/RAHP_file/vg_cate_dict.json', 'r') as f:
# cate_info = json.load(f)
# obj_classes = cate_info["ent_cate"][:-1 ]
# rel_classes = cate_info["pred_cate"]
# super_obj_classes = cate_info.get("super_ent_cate", [])
# print(f'super_obj_classes:{super_obj_classes}')