当前位置: 首页 > news >正文

网站建设策划书案例自己做网站需要什么软件

网站建设策划书案例,自己做网站需要什么软件,中国贸易信息网,dedecms怎么部署网站代码使用方法注意修改一下路径、验证集比例、类别名称#xff0c;其他均不需要改动#xff0c;自动划分训练集、验证集、建好全部文件夹、一键自动生成Yolo格式数据集在当前目录下#xff0c;大家可以直接修改相应的配置文件进行训练。 目录 使用方法#xff1a; 全部代码…代码使用方法注意修改一下路径、验证集比例、类别名称其他均不需要改动自动划分训练集、验证集、建好全部文件夹、一键自动生成Yolo格式数据集在当前目录下大家可以直接修改相应的配置文件进行训练。 目录 使用方法 全部代码 使用方法 全部代码 import os,random,shutilimport xml.etree.ElementTree as ET import pickle import os from os import listdir,getcwd from os.path import joindef convert(size,box):x_center(box[0]box[1])/2.0y_center(box[2]box[3])/2.0xx_center/size[0]yy_center/size[1]w(box[1]-box[0])/size[0]h(box[3]-box[2])/size[1]return (x,y,w,h)def convert_annotation(xml_file_path,save_txt_file_path,classes):xml_fileos.listdir(xml_file_path)print(xml_file)for xml_name in xml_file:print(xml_file)xml_fileos.path.join(xml_file_path,xml_name)out_txt_pathos.path.join(save_txt_file_path,xml_name.split(.)[0].txt)out_txt_fopen(out_txt_path,w)treeET.parse(xml_file)roottree.getroot()sizeroot.find(size)wint(size.find(width).text)hint(size.find(height).text)for obj in root.iter(object):difficult obj.find(difficult).textclsobj.find(name).textif cls not in classes or int(difficult)1:continuecls_idclasses.index(cls)xmlboxobj.find(bndbox)b(float(xmlbox.find(xmin).text),float(xmlbox.find(xmax).text),float(xmlbox.find(ymin).text),float(xmlbox.find(ymax).text))print(w,h,b)bbconvert((w,h),b)out_txt_f.write(str(cls_id) .join([str(a) for a in bb])\n)def moving(fileDir,tarDir,rate0.2):pathDiros.listdir(fileDir)filenumberlen(pathDir)#自定义抽取图片比例picknumberint(filenumber*rate)#按照rate比例从文件夹中取一定数量的图片samplerandom.sample(pathDir,picknumber)#随机选取picknumber数量的图片print(sample)for name in sample:shutil.move(fileDir/name,tarDir/name)returndef movelabel(file_list,file_label_train,file_label_val):for i in file_list:if i.endswith(.png) or i.endswith(.jpg):#filenamefile_label_train/i[:-4]       可以将.xml文件将.txt改成.xml文件filenamefile_label_train/i[:-4].xml       #可以改成xml文件将.txt改成.xmlif os.path.exists(filename):shutil.move(filename,file_label_val)print(处理成功)if __name____main__:设置图片路径、label路径、验证集比例、类别fileDirr./JPEGImages    #图片的路径file_label_train r./Annotations    #标签文件的路径rate0.2  #验证集的比例classes1 [fire]以下均不需要改动if not os.path.exists(./JPEGImages_val):# Create the folderos.makedirs(./JPEGImages_val)tarDirr./JPEGImages_valmoving(fileDir,tarDir,rate)file_listos.listdir(tarDir)if not os.path.exists(./Annotations_val):# Create the folderos.makedirs(./Annotations_val)file_label_valr./Annotations_valmovelabel(file_list,file_label_train,file_label_val)#VOC转Yolo格式# 2 voc 格式的xml标签文件if not os.path.exists(./val):# Create the folderos.makedirs(./val)if not os.path.exists(./train):# Create the folderos.makedirs(./train)xml_files1 r./Annotations_valsave_txt_files1 r./valconvert_annotation(xml_files1, save_txt_files1, classes1)xml_files1 r./Annotationssave_txt_files1 r./trainconvert_annotation(xml_files1, save_txt_files1, classes1)#创建所有文件夹if not os.path.exists(./images):# Create the folderos.makedirs(./images)if not os.path.exists(./labels):# Create the folderos.makedirs(./labels)#将所有文件移动到最终的文件夹中import shutil# Define the source and destination folderssource_folder ./traindestination_folder ./labels# Move the files from the source folder to the destination foldershutil.move(source_folder, destination_folder)source_folder ./valdestination_folder ./labels# Move the files from the source folder to the destination foldershutil.move(source_folder, destination_folder)source_folder ./JPEGImagesdestination_folder ./images# Move the files from the source folder to the destination foldershutil.move(source_folder, destination_folder)os.rename(./images/JPEGImages, ./images/train)source_folder ./JPEGImages_valdestination_folder ./images# Move the files from the source folder to the destination foldershutil.move(source_folder, destination_folder)os.rename(./images/JPEGImages_val, ./images/val)
http://www.pierceye.com/news/146175/

相关文章:

  • wordpress使用端口百度seo排名软
  • 用英文字母做网站关键词个人网站的设计与实现专业论文图像处理工具
  • 重庆企业网站推广流程php网站开发技术训练心得
  • 汽车销售网站学校建网站
  • 两台电脑一台做服务器 网站潍坊专业网站建设多少钱
  • 青岛科技街网站建设安徽 网站开发
  • 黑糖不苦建设的网站wordpress获取文章图片不显示
  • 美食网站建设的功能免费做简历的网站
  • 网站建设公司谁管手机如何创建网站
  • 可以自己做网站优化吗最好用的wordpress主题
  • 瓜子二手车网站开发智慧团建注册登记入口
  • 青岛网站开发建设安阳市商祺网络有限责任公司
  • 自己怎么做装修网站网站建设设计岗位职责
  • php语言 网站建设投资2 3万小生意
  • 全美网站开发微转app是用网站做的吗
  • 禹州 什么团购网站做的好广州网站建设程序开发
  • 成都市微信网站建设公司专业app开发
  • 郑州网站建设hndream神木网站设计公司
  • 关于网站集约化建设的讲话抓取网站访客qq号码
  • 南昌住房城市建设支行官方网站海洋网络提供网站建设
  • 网站外链建设的八大基本准则做网站卖得出去吗
  • 网站建设不完整 审核天元建设集团有限公司一公司尤作岭
  • 论坛程序做导航网站专做轮胎的网站
  • 网站开发软件解决方案个人网站可以做资讯吗
  • 网站右击无效是怎么做的牛商网建设的食品网站
  • 新北网站建设全网营销网站建设
  • 网站建设与管理 教学设计自己的身份已经网站备案了
  • 长沙网站列表网站开发实例及研究
  • 东莞阳光网官方网站吉林百度查关键词排名
  • 网站开发投标书范本目录左旗网站建设