YuqianFu's picture
Upload folder using huggingface_hub
625a17f verified
import json
import os
from PIL import Image
import numpy as np
from pycocotools.mask import encode, decode, frPyObjects
from tqdm import tqdm
import copy
if __name__ == '__main__':
# 统计json文件中的数目
json_path = "/data/work-gcp-europe-west4-a/yuqian_fu/datasets/HANDAL/test_json"
# json_name = os.listdir(json_path)
# for name in json_name:
with open("/work/yuqian_fu/Data/datasets/DAVIS/2017/trainval_val_psalm_instruction_train_correct_new.json", "r") as fp:
data = json.load(fp)
print(len(data))
# 统计文件夹中图片的数目
# img_path = "/data/work-gcp-europe-west4-a/yuqian_fu/datasets/HANDAL/handal_dataset_mugs/train/001010/rgb"
# data = os.listdir(img_path)
# print(len(data))