数据处理
gggi520
这个作者很懒,什么都没留下…
展开
-
遮住不需要的图片内容并且删除其label
遮住不需要的图片内容并且删除其label import cv2 import numpy as np import os,random import xml.dom.minidom # from PIL import Image import os,shutil import math def xml_write(picname,info,img_len,img_height): xml_file = open((picname[0:-4]+'.xml'),'w') xml_file原创 2021-05-19 20:39:37 · 110 阅读 · 0 评论 -
图片数据扩增局部裁剪,xml文件自动跟随裁剪图片重新删减
import cv2 import numpy as np import os import xml.dom.minidom from PIL import Image import random def write_xml(info,width,height,xml_dir='new/'): info1=info[0][:-4]+'.jpg' #write in xml file xml_file = open((xml_dir + info1[:-4]+'.xml').原创 2021-05-09 15:40:41 · 628 阅读 · 0 评论 -
随机复制xml文件与相对应的jpg文件
import cv2 import numpy as np import os import xml.dom.minidom from PIL import Image import random def write_xml(info): info1=info[0][0:6]+'.jpg' img_dir='JPEGImages/' im = Image.open(img_dir+info1) width,height = im.size xml_dir=.原创 2021-05-07 14:41:02 · 217 阅读 · 1 评论