labelImg基础

介绍

安装

Mac系统

安装pyqt

1
2
3
$ brew install cartr/qt4/pyqt
# 检测pyqt是否可用(若不报错,说明OK,若报错,需要进行修改)
$ import PyQt4

配置环境变量(如果pyqt有问题,则执行此步骤)

1
2
3
4
5
6
$ which python
/usr/bin/python
$ which brew
/usr/local/bin/brew
$ cd /usr/local/lib/python2.7/site-packages
$ vi ~/.bash_profile

将下面的代码加入~/.bash_profile中:

1
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH

然后关闭terminal,重新开启,进入python中

1
import PyQt4

这样,PyQt4就装好了。

安装labelImg(Python2)

1
2
3
4
5
$ brew install qt qt4
$ brew install libxml2
$ make all
$ ./labelImg.py
$ ./labelImg.py [IMAGE_PATH] [PRE-DEFINED CLASS FILE]

安装labelImg(Python3)

1
2
3
4
5
$ brew install qt
$ brew install libxml2
$ pip3 install lxml
$ make qt5py3
$ python3 labelImg.py

参考

坚持原创技术分享,您的支持将鼓励我继续创作!