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.数据格式
<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>