- 博客(3)
- 收藏
- 关注
原创 修改xml中的w和h
from xml.etree import ElementTree as ETimport os.pathimport cv2 as cvdef chang_w_h(xml_path,img_path): for filename in os.listdir(xml_path): num = filename[:5] #获取编号 img = cv.imread(img_path + num + '.jpg') h,w,d = im.
2021-06-07 17:47:57 299
原创 python批量修改文件名字
import osdef rename(path): # 图片编号从多少开始,不要跟VOC原本的编号重复了 i = 1 for filename in os.listdir(path): print(filename) if filename.endswith('.jpg') or filename.endswith('.bmp'): n = 4 - len(str(i)) #编号前面(n-1)个零 .
2021-06-03 15:09:52 81
原创 目标检测训练单通道图片,批量变三通道,批量修改xml中的depth
import osimport cv2 as cvdef change_channel(path): for file in os.listdir(path): pic_file = path + file src = cv.imread(pic_file) print(src) gray = cv.cvtColor(src, cv.COLOR_BGR2GRAY) print(gray) .
2021-06-03 11:56:04 368
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人