![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据集处理
Sakura_djiaxin
永远年轻,永远热泪盈眶。
展开
-
MMdetection训练voc数据集
查看官方的安装文档https//mmdetection.readthedocs.io/zh_CN/latest/get_started.html#id2。MMdetection支持coco和voc数据集两种格式,也可以自定义数据集。最好使用的是coco格式,我先用的是voc格式,所以介绍一下voc格式。(2)修改模型这里的模型是你需要跑的实验的模型。从git上面下载方法,需要注意最后这个命令。1、安装MMdetection。2、准备voc格式数据集。...原创 2022-07-22 20:08:27 · 1207 阅读 · 0 评论 -
图像切分成小图
import osfrom xml.dom.minidom import Documentimport numpy as npimport copyimport cv2import sysdef clip_image(file_idx, image, width, height, stride_w, stride_h): shape = image.shape # os.mkdir(os.path.join(save_dir, file_idx)) #clas原创 2022-05-11 21:50:50 · 128 阅读 · 0 评论 -
按照txt坐标对图片进行切分
import os,cv2,numpy as npdef bording_judge(im,x1,y1,x2,y2): #真值代表的是ymin,xmin,ymax,xmax w,h=(x2-x1)*2,(y2-y1)*2 x_min,y_min,x_max,y_max=0,0,im.shape[0],im.shape[0] center_x,center_y=x1-w/2,y2-h/2 # x1=int(max(x1-w/2,x_min)) # y1=int(ma原创 2022-05-11 21:47:04 · 221 阅读 · 0 评论 -
区分数据集每张图片的类别并分别保存
from cgi import print_argumentsimport shutilimport randomimport osimport pathlibimport numpy as npimport pandas as pdfrom numpy import sizefrom collections import Counter# from torch import classesimg_path = 'val/val/images'txt_path = 'val/val/原创 2022-05-04 20:26:17 · 262 阅读 · 0 评论