windows下python3安装rolabelimg或者labelimg2标注斜框

1.前言

大家常用labelimg标注物体,但当目标物体是倾斜角度时,labelimg标注时会把不属于物体的一大片区域也标注,这样标注效果不大好,那么有什么工具可以标注倾斜的矩形框呢,本篇通过介绍安装rolabelimg或者labelimg2(这两个除了UI界面不同,操作起来都一样),来解决该问题。
安装

2.安装

1.安装labelimg

要装rolabelimg要先装labelimg

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple  labelImg==1.8.3

2.安装rolabelimg或者labelimg2

去github下载项目

rolabelimg

https://github.com/cgvict/roLabelImg

labelimg2

https://github.com/chinakook/labelImg2

3.运行

解压后,进入项目中运行一下命令即可驱动

labelimg2的界面

python labelImg.py

在这里插入图片描述

rolabelimg的界面

python roLabelImg.py

在这里插入图片描述
报错注意:
运行roLabelImg.py,遇到报错:name ‘codecs’ is not defined时,只需将roLabelImg.py文件中的头部的

# -- coding: utf8 --

改成

改成# -- coding: utf-8 --

4.操作快捷键

在这里插入图片描述

5.数据格式

labelimg2的格式

<annotation verified="yes">
	<folder>images</folder>
	<filename>fire_000003.jpg</filename>
	<path>H:\fire_img\fire_smoke\images\fire_000003.jpg</path>
	<source>
		<database>Unknown</database>
	</source>
	<size>
		<width>490</width>
		<height>367</height>
		<depth>3</depth>
	</size>
	<segmented>0</segmented>
	<object>
		<name>dog</name>
		<pose>Unspecified</pose>
		<truncated>0</truncated>
		<difficult>0</difficult>
		<bndbox>
			<xmin>329</xmin>
			<ymin>103</ymin>
			<xmax>389</xmax>
			<ymax>179</ymax>
		</bndbox>
		<extra/>
	</object>
	<object>
		<name>dog</name>
		<pose>Unspecified</pose>
		<truncated>0</truncated>
		<difficult>0</difficult>
		<robndbox>
			<cx>278.1473</cx>
			<cy>157.4751</cy>
			<w>37.0</w>
			<h>40.0</h>
			<angle>1.237309</angle>
		</robndbox>
		<extra/>
	</object>
</annotation>

roLabelImg的格式

<annotation verified="yes">
  <folder>hsrc</folder>
  <filename>100000001</filename>
  <path>/Users/haoyou/Library/Mobile Documents/com~apple~CloudDocs/OneDrive/hsrc/100000001.bmp</path>
  <source>
    <database>Unknown</database>
  </source>
  <size>
    <width>1166</width>
    <height>753</height>
    <depth>3</depth>
  </size>
  <segmented>0</segmented>
  <object>
    <type>bndbox</type>
    <name>ship</name>
    <pose>Unspecified</pose>
    <truncated>0</truncated>
    <difficult>0</difficult>
    <bndbox>
      <xmin>178</xmin>
      <ymin>246</ymin>
      <xmax>974</xmax>
      <ymax>504</ymax>
    </bndbox>
  </object>
  <object>
    <type>robndbox</type>
    <name>ship</name>
    <pose>Unspecified</pose>
    <truncated>0</truncated>
    <difficult>0</difficult>
    <robndbox>
      <cx>580.7887</cx>
      <cy>343.2913</cy>
      <w>775.0449</w>
      <h>170.2159</h>
      <angle>2.889813</angle>
    </robndbox>
  </object>
</annotation>

roLabelImg比labelimg2的数据也就多了一个参数。
经过测试,rolabelimg无法导入labelimg2和labelimg标注数据。
而labelimg2则可以正常导入其它2种标注工具的标注过的数据。

  • 6
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值