from cv2 import cv2
import os
import json
import numpy as np
path = "./data/"
save_path = "./output/"
if not os.path.exists(save_path):
os.mkdir(save_path)
os.makedirs(save_path+"dog")
os.makedirs(save_path + "cat")
img_list=[]
label_list=[]
point_list=[]
for i in os.listdir(path):
if i.endswith("json"):
with open(path+i,'r') as f:
data = json.load(f).get("shapes")[0]
point=np.array(data["points"]).astype(int)
point_list.append(point)
label_list.append(data["label"])
else:
img_list.append(cv2.imread(path + i))
cat_count=0
dog_count=0
for i in range(0,len(img_list)):
img