
数据处理
猛男技术控
苦心钻研!
勇于实践!
不负韶华!
展开
-
图片分类-数据增强
import os import PIL.Image as Image import shutil from torchvision import transforms from numpy.random import randint,random def zengqiang(root_path): for img in os.listdir(root_path): i = 0. if img[-3:] in ["jpg", "png", "JPG","bmp"]:原创 2021-04-24 21:24:24 · 317 阅读 · 1 评论 -
voc数据集xml文件转换为txt文件并划分训练集、测试集
如何提取voc中的某一类这里有写:https://xiaobaibubai.blog.csdn.net/article/details/115660715 本代码可以将voc数据集xml文件转换为txt文件: import xml.etree.ElementTree as ET import pickle import os from os import listdir, getcwd from os.path import join # 改变坐标格式 def convert(size, box):原创 2021-04-13 14:11:20 · 1530 阅读 · 2 评论 -
提取voc数据集中特定的类
先贴出代码: import shutil import os import xml.etree.ElementTree as ET Annotations_path = r"E:/data/voc/VOCdevkit/VOC2007/Annotations" image_path = r"E:/data/voc/VOCdevkit/VOC2007/JPEGImages" save_img_path = r"E:/data/voc/VOCdevkit/VOC2007/tte/" save_xml_path原创 2021-04-13 12:31:38 · 1321 阅读 · 6 评论