Spaces:
Runtime error
Runtime error
File size: 618 Bytes
19a149b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
import cv2
import json
import os
from pycocotools import mask as mask_utils
import numpy as np
from tqdm import tqdm
json_path = 'path/UVO/UVO_sparse_train_video_with_interpolation.json'
output_path = "path/UVO/UVO_sparse_train_video_with_interpolation_reorg.json"
with open(json_path, 'r') as fcc_file:
data = json.load(fcc_file)
info = data['info']
videos = data['videos']
print(len(videos))
uvo_dict = {}
for video in tqdm(videos):
vid = video['id']
file_names = video['file_names']
uvo_dict[vid] = file_names
with open(output_path,"w") as f:
json.dump(uvo_dict,f)
print('finish')
|