def generate_categories_file(dataPath='./class', newDataPath='./categories.json'):
    print('-- generating categories file --')
    with open(osp.join(dataPath, 'objects.txt'), 'r') as f:
        object_label = f.read().split('\n')
    with open(osp.join(dataPath, 'relationships.txt'), 'r') as f:
        relationship_label = f.read().split('\n')
    with open(osp.join(dataPath, 'colors.txt'), 'r') as f:
        color_label = f.read().split('\n')
    with open(osp.join(dataPath, 'open_states.txt'), 'r') as f:
        openState_label = f.read().split('\n')
    with open(osp.join(dataPath, 'off_states.txt'), 'r') as f:
        offState_label = f.read().split('\n')
    categories = {}
    categories['object'] = object_label[1:]
    categories['predicate'] = relationship_label[1:]
    categories['color'] = color_label
    categories['open_state'] = openState_label
    with open(newDataPath, 'w') as f:
        json.dump(categories, f, indent='\t')
    print('data dumpping complete')
    print('file path:', newDataPath)
def generate_categories_file(dataPath='./class', newDataPath='./categories.json'):
    print('-- generating categories file --')
    with open(osp.join(dataPath, 'objects.txt'), 'r') as f:
        object_label = f.read().split('\n')
    with open(osp.join(dataPath, 'relationships.txt'), 'r') as f:
        relationship_label = f.read().split('\n')
    with open(osp.join(dataPath, 'colors.txt'), 'r') as f:
        color_label = f.read().split('\n')
    with open(osp.join(dataPath, 'open_states.txt'), 'r') as f:
        openState_label = f.read().split('\n')
    with open(osp.join(dataPath, 'off_states.txt'), 'r') as f:
        offState_label = f.read().split('\n')
    categories = {}
    categories['object'] = object_label[1:]
    categories['predicate'] = relationship_label[1:]
    categories['color'] = color_label
    categories['open_state'] = openState_label
    with open(newDataPath, 'w') as f:
        json.dump(categories, f, indent='\t')
    print('data dumpping complete')
    print('file path:', newDataPath)