LabelImg用于图像检测数据集的制作,使用python编写,Qt作为图形接口。
Annotation的结果以PASCAL VOC格式,存储为XML文件,同时也支持YOLO格式。
项目地址:
tzutalin/labelImggithub.com安装
推荐环境:python3 + Qt5 Terminal运行以下命令。
- Python2+Qt4 安装 (本人未实践
brew install qt qt4
brew install libxml2
make qt4py2
python labelImg.py
python labelImg.py [IMAGE_PATH] [PRE-DEFINED CLASS FILE]
2. Python3 + Qt5 (推荐
brew install qt
brew install libxml2
brew install pyqt5
make qt5py3
# 下载上面链接的zip解压,cd到这个文件夹的位置
python3 labelImg.py
运行成功会出现图形操作界面。
3. Python Virtualenv (推荐
virtual环境可以避免python和Qt的一些版本问题
brew install python3
pip3 install pipenv
pipenv --three # or pipenv install pyqt5 lxml
pipenv run pip install pyqt5 lxml
pipenv run make qt5py3
python3 labelImg.py
使用
视频demo:
https://www.bilibili.com/video/av58221619?from=search&seid=15277283772013665755www.bilibili.com整体界面:
点击open dir,打开你的图片文件夹读取图片。
创建标记框:点击Create/nRecBox,选出来图片的目标,输入label,保存annotation为xml文件。
快捷键
Command + U 倒入文件目录的所有图片
Command + R 更换anaotation保存路径
Command + S 保存
Command + D 复制当前label和矩形框
Space flag当前图片作为verified (verify image:When pressing space, the user can flag the image as verified, a green background will appear. This is used when creating a dataset automatically, the user can then through all the pictures and flag them instead of annotate them.)
W 创建矩形框
D 下一张图
A 上一张图
Delete 删除选中的矩形框
Command + + 放大
Command + - 缩小
⬆⬇⬅➡ 移动矩形框