import json text_path1 = "/data/work-gcp-europe-west4-a/yuqian_fu/Ego/data_segswap/exoego_nullmask_train_new.json" text_path2 = "/data/work-gcp-europe-west4-a/yuqian_fu/Ego/data_segswap/exoego_nullmask_eval.json" #text_path2 = "/data/work-gcp-europe-west4-a/yuqian_fu/datasets/DAVIS/2017/trainval_val_psalm_withtext_train_new_v2.json" # text_path3 = "/data/work-gcp-europe-west4-a/yuqian_fu/Ego/data_segswap/ExoQuery_val_newprompt_v3.json" # text_path4 = "/data/work-gcp-europe-west4-a/yuqian_fu/Ego/data_segswap/ExoQuery_val_newprompt_v4.json" # text_path5 = "/data/work-gcp-europe-west4-a/yuqian_fu/Ego/data_segswap/ExoQuery_val_newprompt_v5.json" # text_path6 = "/data/work-gcp-europe-west4-a/yuqian_fu/Ego/data_segswap/ExoQuery_val_newprompt_v6.json" # text_path7 = "/data/work-gcp-europe-west4-a/yuqian_fu/Ego/data_segswap/ExoQuery_val_newprompt_v7.json" # text_path8 = "/data/work-gcp-europe-west4-a/yuqian_fu/Ego/data_segswap/ExoQuery_val_newprompt_v8.json" save_path = '/data/work-gcp-europe-west4-a/yuqian_fu/Ego/data_segswap/exoego_nullmask_all.json' with open(text_path1) as fp1: datas1 = json.load(fp1) with open(text_path2) as fp2: datas2 = json.load(fp2) # with open(text_path3) as fp3: # datas3 = json.load(fp3) # with open(text_path4) as fp4: # datas4 = json.load(fp4) # with open(text_path5) as fp5: # datas5 = json.load(fp5) # with open(text_path6) as fp6: # datas6 = json.load(fp6) # with open(text_path7) as fp7: # datas7 = json.load(fp7) # with open(text_path8) as fp8: # datas8 = json.load(fp8) #datas_all = datas1 + datas2 + datas3 + datas4 + datas5 + datas6 + datas7 + datas8 datas_all = datas1 + datas2 print(len(datas_all)) with open(save_path, "w") as fp: json.dump(datas_all, fp)