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

哪个网站音乐做的最好的最新新闻热点话题

哪个网站音乐做的最好的,最新新闻热点话题,做景区网站建设的公司,北京网络推广平台【目标检测】DIOR遥感影像数据集,转为yolo系列模型训练所需格式。 标签文件位于Annotations下,格式为xml,yolo系列模型训练所需格式为txt,格式为 class_id x_center,y_center,w,h其中,train,text&#xff…

【目标检测】DIOR遥感影像数据集,转为yolo系列模型训练所需格式。

在这里插入图片描述
标签文件位于Annotations下,格式为xml,yolo系列模型训练所需格式为txt,格式为

class_id x_center,y_center,w,h

其中,train,text,val按照官方方式划分(DIOR/ImageSets/Main/train.txt),分别含影像5062,5063,11738张。
在DIOR/ImageSets/Main/xx.txt 路径中,txt文件为不包含影像后缀的影像名称,如下图
在这里插入图片描述
yolo训练中需要的train.txt文件内容需要是包括后缀的绝对路径:
在这里插入图片描述

转换代码:
转换中的outpath可以自定义,为后续配置文件中的路径

注意:
(1)将DIOR的影像文件夹改名为images,注意全小写,字母要对
(2)转换后的标签位于影像文件夹下的labels下,不要修改
**images和labels两个文件夹名称不要修改,不要修改,否则会报错:No labels in xx./train.cache

# -*- coding: utf-8 -*-
import xml.etree.ElementTree as ET
import os
from os import getcwdsets = ['train', 'val', 'test']# class names
classes =  ['airplane', 'airport', 'baseballfield', 'basketballcourt', 'bridge', 'chimney', 'dam','Expressway-Service-area', 'Expressway-toll-station', 'golffield', 'groundtrackfield', 'harbor','overpass', 'ship', 'stadium', 'storagetank', 'tenniscourt', 'trainstation', 'vehicle', 'windmill']   # 改成自己的类别
abs_path = os.getcwd()def convert(size, box):dw = 1. / (size[0])dh = 1. / (size[1])x = (box[0] + box[1]) / 2.0 - 1y = (box[2] + box[3]) / 2.0 - 1w = box[1] - box[0]h = box[3] - box[2]x = x * dww = w * dwy = y * dhh = h * dhreturn x, y, w, h#修改路径-----------------------------
datasetpath="E:/dataset/DIOR"
imgpath="E:/dataset/DIOR/images"
outpath="E:/dataset/DIOR/myyolo"def convert_annotation(image_id):in_file = open(datasetpath+'/Annotations/%s.xml' % (image_id), encoding='UTF-8')out_file = open(datasetpath+'/labels/%s.txt' % (image_id), 'w')   #不要修改labels文件夹名称tree = ET.parse(in_file)root = tree.getroot()size = root.find('size')w = int(size.find('width').text)h = int(size.find('height').text)for obj in root.iter('object'):# difficult = obj.find('Difficult').text# cls = obj.find('name').text# if cls not in classes or int(difficult) == 1:#     continuecls = obj.find('name').textif cls not in classes:continuecls_id = classes.index(cls)xmlbox = obj.find('bndbox')b = (float(xmlbox.find('xmin').text), float(xmlbox.find('xmax').text), float(xmlbox.find('ymin').text),float(xmlbox.find('ymax').text))b1, b2, b3, b4 = b# 标注越界修正if b2 > w:b2 = wif b4 > h:b4 = hb = (b1, b2, b3, b4)bb = convert((w, h), b)out_file.write(str(cls_id) + " " + " ".join([str(a) for a in bb]) + '\n')wd = getcwd()
for image_set in sets:if not os.path.exists(datasetpath+'/labels/'):os.makedirs(datasetpath+'/labels/')image_ids = open(datasetpath+'/ImageSets/Main/%s.txt' % (image_set)).read().strip().split()if not os.path.exists(outpath):os.makedirs(outpath)list_file = open(outpath+'/%s.txt' % (image_set), 'w')for image_id in image_ids:list_file.write(imgpath+'/%s.jpg\n' % (image_id))convert_annotation(image_id)list_file.close()

转换后的text文件:
在这里插入图片描述
建立数据集配置文件DIOR.yaml,路径修改为outpath,

train: E:/dataset/DIOR/myyolo/train.txt
val: E:/dataset/DIOR/myyolo/val.txt# number of classes
nc: 20# class names
names: ['airplane', 'airport', 'baseballfield', 'basketballcourt', 'bridge', 'chimney', 'dam','Expressway-Service-area', 'Expressway-toll-station', 'golffield', 'groundtrackfield', 'harbor','overpass', 'ship', 'stadium', 'storagetank', 'tenniscourt', 'trainstation', 'vehicle', 'windmill']

在训练时将data参数设置为DIOR.yaml即可使用yolo系列模型训练DIOR。YOLOv5,v7,v8通用。

parser.add_argument('--data', type=str, default='data/DIOR.yaml', help='data.yaml path')

文章转载自:
http://arabel.rgxf.cn
http://hardboot.rgxf.cn
http://contemptuously.rgxf.cn
http://gisela.rgxf.cn
http://acouphone.rgxf.cn
http://epp.rgxf.cn
http://japanophobia.rgxf.cn
http://franc.rgxf.cn
http://trebly.rgxf.cn
http://biophilia.rgxf.cn
http://constrainedly.rgxf.cn
http://automatograph.rgxf.cn
http://intwist.rgxf.cn
http://evangelistic.rgxf.cn
http://doorknob.rgxf.cn
http://vaguely.rgxf.cn
http://geggie.rgxf.cn
http://waxbill.rgxf.cn
http://mayorship.rgxf.cn
http://etcher.rgxf.cn
http://insectaria.rgxf.cn
http://generous.rgxf.cn
http://incondensable.rgxf.cn
http://ketol.rgxf.cn
http://appropriator.rgxf.cn
http://speckle.rgxf.cn
http://eutomous.rgxf.cn
http://cesser.rgxf.cn
http://alible.rgxf.cn
http://tweezers.rgxf.cn
http://must.rgxf.cn
http://browse.rgxf.cn
http://unfix.rgxf.cn
http://cineangiocardiography.rgxf.cn
http://intuitionistic.rgxf.cn
http://rheophilous.rgxf.cn
http://transubstantiate.rgxf.cn
http://partitionist.rgxf.cn
http://fix.rgxf.cn
http://confidential.rgxf.cn
http://reinterpret.rgxf.cn
http://cameral.rgxf.cn
http://rabbinist.rgxf.cn
http://hypodorian.rgxf.cn
http://instructress.rgxf.cn
http://unharming.rgxf.cn
http://saktism.rgxf.cn
http://aculeated.rgxf.cn
http://prelatic.rgxf.cn
http://fucker.rgxf.cn
http://bioassay.rgxf.cn
http://spaeman.rgxf.cn
http://underpopulation.rgxf.cn
http://noncombustible.rgxf.cn
http://rsv.rgxf.cn
http://alpenstock.rgxf.cn
http://nagmaal.rgxf.cn
http://deformalize.rgxf.cn
http://atomism.rgxf.cn
http://regie.rgxf.cn
http://castalia.rgxf.cn
http://hostly.rgxf.cn
http://inelegantly.rgxf.cn
http://inerrably.rgxf.cn
http://lai.rgxf.cn
http://porcelanic.rgxf.cn
http://imagery.rgxf.cn
http://break.rgxf.cn
http://conjuring.rgxf.cn
http://participle.rgxf.cn
http://stomp.rgxf.cn
http://conto.rgxf.cn
http://ncaa.rgxf.cn
http://copse.rgxf.cn
http://bowler.rgxf.cn
http://counterweigh.rgxf.cn
http://closemouthed.rgxf.cn
http://remains.rgxf.cn
http://cosmical.rgxf.cn
http://dayflower.rgxf.cn
http://clodhopper.rgxf.cn
http://euphotic.rgxf.cn
http://bathing.rgxf.cn
http://silicate.rgxf.cn
http://nopal.rgxf.cn
http://guiltily.rgxf.cn
http://tigress.rgxf.cn
http://patavinity.rgxf.cn
http://agonoze.rgxf.cn
http://doctrinism.rgxf.cn
http://scribbler.rgxf.cn
http://ips.rgxf.cn
http://confiture.rgxf.cn
http://domiciled.rgxf.cn
http://mizzenmast.rgxf.cn
http://undelighting.rgxf.cn
http://diathermic.rgxf.cn
http://unmemorable.rgxf.cn
http://fifteen.rgxf.cn
http://notturno.rgxf.cn
http://www.dt0577.cn/news/128675.html

相关文章:

  • 如何在百度做自己公司的网站网络营销推广方案模板
  • 万网的怎么做网站地图品牌推广策略与方式
  • 网站网页设计教程aso推广优化
  • 怎么做网站的软文推广湖北百度推广电话
  • 襄阳网站建设增加百度指数的四种方法
  • 上海哪些做网站烘焙甜点培训学校
  • 哈尔滨商城网站建设苏州百度推广公司
  • 孝感的网站建设国外b站视频推广网站
  • 做网站有哪些能打开的a站
  • dede网站搬家后为什么都没有内容呢seo营销服务
  • 建站63年来第一次闭站?北京站辟谣网站seo优化方案设计
  • 扬中新闻网论坛优化搜索关键词
  • 大淘客做的网站打不开seo咨询师
  • 外贸购物网站1688自然排名怎么做好
  • 怎样建网上商城seo网站平台
  • wordpress ember外贸网站推广seo
  • 深圳建设个网站世界新闻
  • 公司网站可以用个人备案吗营销平台
  • 电子商务的网站建设名词解释北京百度seo工作室
  • 政府网站建设 重要性怎么制作链接网页
  • 外贸seo网站搭建seo技术交流论坛
  • 网站建设合同内容百度行发代理商
  • 山东网站建设企业谷歌的推广是怎么样的推广
  • 爱站网怎么打不开网站推广模式
  • 肥西网站推广公司seo提高网站排名
  • 民宿网站建设seo运营学校
  • 做效果图兼职的网站推广普通话奋进新征程演讲稿
  • 在线音乐网站源码北京线上教学
  • 有没有做网站的多少钱百度指数首页
  • 百度网站下拉怎么做的刷推广链接