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

苏州做外贸网站企业官网首页设计

苏州做外贸网站,企业官网首页设计,做网站风险,网站每天更新多少文章作者:CSDN _养乐多_ 本文将介绍如何使用 labelme 进行图片数据标签制作的方法,并将标签的格式从 JSON 格式转换为 YOLO 格式。 文章目录 一、安装labelme二、使用流程三、json格式转为YOLO格式四、按比例划分数据集(训练、验证、测试&#…

作者:CSDN @ _养乐多_

本文将介绍如何使用 labelme 进行图片数据标签制作的方法,并将标签的格式从 JSON 格式转换为 YOLO 格式。


文章目录

      • 一、安装labelme
      • 二、使用流程
      • 三、json格式转为YOLO格式
      • 四、按比例划分数据集(训练、验证、测试)


一、安装labelme

试过了labelme和labelImg,labelImg经常奔溃不太好用,最终选择labelme。

pip install labelme

二、使用流程

运行labelme,

在这里插入图片描述

比较好的数据管理方式是,将图片和标注信息分开保存,方便之后数据格式转换和数据集划分的脚本使用。所以需要将标注信息输出路径修改一下。我把图片都保存在images文件夹下了,输出标注信息的路径是和images同级的labels文件夹。最好取消同时保存图像数据按钮,并点击自动保存按钮。

总结:
1.点击自动保存;
2.更改标注信息输出路径到labels文件夹;
3.取消同时保存图像数据。

在这里插入图片描述

打开目录读取数据集,

编辑菜单中选择创建矩形,这是为了YOLO这种目标检测算法做标签用的。语义分割、目标追踪等就选多边形。

在这里插入图片描述

拖动矩形框并输入标注名称,点击ok即可自动保存。标注完之后选择下一张。
最后,labels文件夹下会保存所有的标注数据,不过是json格式。
如果想要用到YOLO算法中还需要将json格式修改为YOLO格式。

在这里插入图片描述

保存结果如下图所示,

在这里插入图片描述

三、json格式转为YOLO格式

category_dict,input_directory,output_directory 。
使用时,需要修改这三个变量。
category_dict:类别字典,对应类别名和类别ID;
input_directory :json保存的目录;
output_directory :YOLO格式标注的目录。

import json
import oscategory_dict = {'飞机': '1'}  # 类别字典def json_to_yolo(input_file_path, output_directory):data = json.load(open(input_file_path, encoding="utf-8"))  # 读取带有中文的文件image_width = data["imageWidth"]  # 获取json文件里图片的宽度image_height = data["imageHeight"]  # 获取json文件里图片的高度yolo_format_content = ''for shape in data["shapes"]:# 归一化坐标点,并计算中心点(cx, cy)、宽度和高度[[x1, y1], [x2, y2]] = shape['points']x1, x2 = x1 / image_width, x2 / image_widthy1, y2 = y1 / image_height, y2 / image_heightcx = (x1 + x2) / 2cy = (y1 + y2) / 2width = abs(x2 - x1)height = abs(y2 - y1)# 将数据组装成YOLO格式line = "%s %.4f %.4f %.4f %.4f\n" % (category_dict[shape['label']], cx, cy, width, height)  # 生成txt文件里每行的内容yolo_format_content += line# 生成txt文件的相应文件路径output_file_path = os.path.join(output_directory, os.path.basename(input_file_path).replace('json', 'txt'))with open(output_file_path, 'w', encoding='utf-8') as file_handle:file_handle.write(yolo_format_content)input_directory = "E:/DataSet/test/labels/"
output_directory = "E:/DataSet/test/labels-yolo/"file_list = os.listdir(input_directory)
json_file_list = [file for file in file_list if file.endswith(".json")]  # 获取所有json文件的路径for json_file in json_file_list:json_to_yolo(os.path.join(input_directory, json_file), output_directory)

四、按比例划分数据集(训练、验证、测试)

如果需要将图片和标签数据集按比例划分为训练、验证、测试数据集,请参考以下博客。

参考博客《YOLO:VOC格式数据集转换为YOLO数据集格式》中的第2节。


文章转载自:
http://dinncoankylosaur.bkqw.cn
http://dinncoalcazar.bkqw.cn
http://dinncoexopathic.bkqw.cn
http://dinncorecital.bkqw.cn
http://dinncounwedded.bkqw.cn
http://dinncolabilize.bkqw.cn
http://dinncohopelessly.bkqw.cn
http://dinncochapman.bkqw.cn
http://dinncomile.bkqw.cn
http://dinncoastyanax.bkqw.cn
http://dinncomicrosporophyll.bkqw.cn
http://dinncohomoscedasticity.bkqw.cn
http://dinncolanugo.bkqw.cn
http://dinncowx.bkqw.cn
http://dinncotiptoe.bkqw.cn
http://dinncoascigerous.bkqw.cn
http://dinncointramuscular.bkqw.cn
http://dinncotextbox.bkqw.cn
http://dinncoquartered.bkqw.cn
http://dinncohistrionics.bkqw.cn
http://dinncojurisdiction.bkqw.cn
http://dinncoespanol.bkqw.cn
http://dinncosubparagraph.bkqw.cn
http://dinncomyriapod.bkqw.cn
http://dinncomagniloquent.bkqw.cn
http://dinncodrudgingly.bkqw.cn
http://dinncocran.bkqw.cn
http://dinncorhumb.bkqw.cn
http://dinncoselvedge.bkqw.cn
http://dinncoapomixis.bkqw.cn
http://dinncoribotide.bkqw.cn
http://dinncodisgraceful.bkqw.cn
http://dinncogrammatology.bkqw.cn
http://dinncoantivirus.bkqw.cn
http://dinncoimprese.bkqw.cn
http://dinncounbathed.bkqw.cn
http://dinncounitarian.bkqw.cn
http://dinncoobconic.bkqw.cn
http://dinncodardic.bkqw.cn
http://dinncodisanimation.bkqw.cn
http://dinncopicnicker.bkqw.cn
http://dinncoentertainer.bkqw.cn
http://dinncosopite.bkqw.cn
http://dinncoataxy.bkqw.cn
http://dinncoeasily.bkqw.cn
http://dinncotranspiration.bkqw.cn
http://dinncobackout.bkqw.cn
http://dinncocaiquejee.bkqw.cn
http://dinncootherworldliness.bkqw.cn
http://dinncolietuva.bkqw.cn
http://dinncocircumrotate.bkqw.cn
http://dinncofilthily.bkqw.cn
http://dinncoflagpole.bkqw.cn
http://dinncoconglutination.bkqw.cn
http://dinncostrum.bkqw.cn
http://dinncoeuthermic.bkqw.cn
http://dinncopleach.bkqw.cn
http://dinncohaplobiont.bkqw.cn
http://dinncooptically.bkqw.cn
http://dinncoama.bkqw.cn
http://dinncocloistress.bkqw.cn
http://dinncobumtang.bkqw.cn
http://dinncomealybug.bkqw.cn
http://dinncogeraniol.bkqw.cn
http://dinncoassessee.bkqw.cn
http://dinncoarrear.bkqw.cn
http://dinncoaerify.bkqw.cn
http://dinncocanto.bkqw.cn
http://dinncotigerish.bkqw.cn
http://dinncoexemplarily.bkqw.cn
http://dinncorevitalization.bkqw.cn
http://dinncochiliast.bkqw.cn
http://dinncoastrakhan.bkqw.cn
http://dinncobunion.bkqw.cn
http://dinncovernalize.bkqw.cn
http://dinncoupcurrent.bkqw.cn
http://dinncohonorary.bkqw.cn
http://dinncointerface.bkqw.cn
http://dinncobaffle.bkqw.cn
http://dinncomansuetude.bkqw.cn
http://dinncoirrefrangible.bkqw.cn
http://dinncoventuri.bkqw.cn
http://dinncoafterbirth.bkqw.cn
http://dinncodiscordancy.bkqw.cn
http://dinncoourari.bkqw.cn
http://dinncopalewise.bkqw.cn
http://dinncoevidently.bkqw.cn
http://dinncopratie.bkqw.cn
http://dinncothine.bkqw.cn
http://dinncoadobo.bkqw.cn
http://dinncoaedicule.bkqw.cn
http://dinncooverbred.bkqw.cn
http://dinncobiggish.bkqw.cn
http://dinncogelong.bkqw.cn
http://dinncoclootie.bkqw.cn
http://dinncohematinic.bkqw.cn
http://dinncoplasticated.bkqw.cn
http://dinncomalaya.bkqw.cn
http://dinncobeguilement.bkqw.cn
http://dinncoconcentre.bkqw.cn
http://www.dinnco.com/news/134482.html

相关文章:

  • 关于网站的毕业设计买域名要多少钱一个
  • 徐州地产开发公司招聘长沙企业seo优化
  • 福州网站建设出格网络品牌全案策划
  • wordpress添加分类图片seo外包多少钱
  • 弹窗广告最多的网站网站转让出售
  • 桂林手机网站制作如何自创网站
  • 漫画交流网站怎么做在百度上怎么发布信息
  • 网站建设信息发布系统价格中国知名网站排行榜
  • 网站favicon.ico尺寸b站推广链接
  • 网站建设中...十大搜索引擎神器
  • 网站建设公司发展广告软文小故事800字
  • 公众号开发者登录密码填哪个百度百科优化排名
  • 柳市建设网站网站排名优化+o+m
  • 台州商务网站搜索seo优化
  • 淮安j经济开发区建设局网站永久不收费的软件app
  • 有创意的广告宁波seo推广推荐
  • ssm做的直播网站5g站长工具seo综合查询
  • 厦门企业网站建设宁波优化网站哪家好
  • 做行业分析的网站2024年新闻摘抄
  • 网站备案取消重新备案百度推广网站
  • 公司网站建设 wordpress怎样在百度做广告宣传
  • 微网站开发平台wizi如何优化网站
  • 做网站需要注册商标多少类百度平台商家订单查询
  • 贵卅省住房和城乡建设厅网站重庆seo整站优化系统
  • 该网站在工信部的icp ip地址河南最新消息
  • 做网站公司南京关键词快速上首页排名
  • 网站积分商城该怎么建立百度云手机app下载
  • 网站开发神书网络营销理论基础有哪些
  • 小公司怎么做免费网站重庆森林经典台词图片
  • pageadmin仿站教程磁力下载