- 博客(6)
- 收藏
- 关注
原创 叠加mask
import cv2img1 = cv2.imread(r'C:\Users\lirui\Desktop\diejiatu\541.png')img2 = cv2.imread(r'C:\Users\lirui\Desktop\diejiatu\542.png')res = cv2.add(img1, img2)rea = cv2.imwrite(r'C:\Users\lirui\Desktop\diejiatu\1954.png',res)
2021-12-28 22:20:02
1706
原创 resize
import cv2import osimage_size_h = 512 # 设定宽image_size_w = 512 # 设定长source_path = r'C:/Users/lirui/Desktop/crop/' # 源文件路径target_path = r'C:/Users/lirui/Desktop/resize_crop/' # 输出目标文件路径if not os.path.exists(target_path): os.makedirs(target_p.
2021-12-20 21:51:23
61
原创 训练测试划分
import osimport shutilimg_dir = "C:/Users/lirui/desktop/data/train/imgs"mask_dir = "C:/Users/lirui/desktop/data/train/masks"test_img_dir = "C:/Users/lirui/desktop/data/test/imgs"test_mask_dir = "C:/Users/lirui/desktop/data/test/masks"img_list = sor.
2021-11-26 18:21:54
1604
原创 将labelme可视化
import osjson_folder = r"C:\Users\lirui\Desktop\mas"FileNameList = os.listdir(json_folder)for i in range(len(FileNameList)): # 判断当前文件是否为json文件 if(os.path.splitext(FileNameList[i])[1] == ".json"): json_file = json_folder + "\\" + Fil.
2021-11-26 15:47:47
242
原创 labelme转同label与img
import os,sysimport shutilold_path="C:\\Users\\lirui\\Desktop\\smas"Paste_JPG_folder = r"C:\Users\lirui\Desktop\1imgs"Paste_label_folder = r"C:\Users\lirui\Desktop\1label"#save_path=filenames = os.listdir(old_path)#print(filenames)newname = 1#f.
2021-11-26 15:06:57
309
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人