2015-09-17 10:37:20 +08:00
# LabelImg
2016-04-19 14:51:28 +08:00
[](https://travis-ci.org/tzutalin/labelImg)
2016-04-11 17:18:33 +08:00
LabelImg is a graphical image annotation tool.
2015-09-17 10:37:20 +08:00
It is written in Python and uses Qt for its graphical interface.
2016-04-01 09:45:35 +08:00
The annotation file will be saved as an XML file. The annotation format is PASCAL VOC format, and the format is the same as [ImageNet ](http://www.image-net.org/ )
2015-09-17 10:37:20 +08:00
2016-09-06 20:42:13 +08:00


2015-09-18 19:29:51 +08:00
2016-06-21 14:14:46 +08:00
[](https://www.youtube.com/watch?v=p0nR2YsCY_U& feature=youtu.be)
2016-04-05 12:28:37 +08:00
2015-09-17 10:37:20 +08:00
## Dependencies
2015-11-23 14:21:55 +08:00
* Linux/Ubuntu/Mac
2015-09-17 10:37:20 +08:00
Requires at least [Python 2.6 ](http://www.python.org/getit/ ) and has been tested with [PyQt
4.8](http://www.riverbankcomputing.co.uk/software/pyqt/intro).
2016-10-22 10:27:50 +08:00
In order to build the resource and assets, you need to install pyqt4-dev-tools and lxml:
```
$ sudo apt-get install pyqt4-dev-tools
$ sudo pip install lxml
$ make all
$ ./labelImg.py
```
2015-09-18 22:49:00 +08:00
2016-10-22 10:27:50 +08:00
Mac requires "$ brew install libxml2" when installing lxml
2015-11-22 16:57:50 +08:00
* Windows
2015-11-23 14:21:55 +08:00
2016-05-10 22:42:13 +08:00
Need to download and setup [Python 2.6 ](https://www.python.org/downloads/windows/ ) or later and [PyQt4 ](https://www.riverbankcomputing.com/software/pyqt/download ). Also, you need to install other python dependencies.
2015-12-04 22:51:44 +08:00
2016-05-10 22:42:13 +08:00
Open cmd and go to [labelImg]
2015-11-22 16:57:50 +08:00
2016-10-22 10:27:50 +08:00
```
$ pyrcc4 -o resources.py resources.qrc
$ python labelImg.py
```
2015-11-22 16:57:50 +08:00
2015-09-17 10:37:20 +08:00
## Usage
2016-04-05 12:28:37 +08:00
After cloning the code, you should run `$ make all` to generate the resource file.
2015-09-17 10:37:20 +08:00
2016-04-05 12:28:37 +08:00
You can then start annotating by running `$ ./labelImg.py` . For usage
2015-09-17 10:42:52 +08:00
instructions you can see [Here ](https://youtu.be/p0nR2YsCY_U )
2015-09-17 10:37:20 +08:00
2016-04-01 09:45:35 +08:00
At the moment annotations are saved as an XML file. The format is PASCAL VOC format, and the format is the same as [ImageNet ](http://www.image-net.org/ )
2015-09-17 10:37:20 +08:00
2015-09-17 10:42:52 +08:00
You can also see [ImageNet Utils ](https://github.com/tzutalin/ImageNet_Utils ) to download image, create a label text for machine learning, etc
2015-09-17 10:37:20 +08:00
2015-11-21 00:26:00 +08:00
2015-11-21 17:39:40 +08:00
### General steps from scratch
2016-04-05 12:28:37 +08:00
* Build and launch: `$ make all; python labelImg.py`
2015-11-21 17:39:40 +08:00
* Click 'Change default saved annotation folder' in Menu/File
* Click 'Open Dir'
* Click 'Create RectBox'
2016-05-10 22:42:13 +08:00
The annotation will be saved to the folder you specify
### Create pre-defined classes
You can edit the [data/predefined_classes.txt ](https://github.com/tzutalin/labelImg/blob/master/data/predefined_classes.txt ) to load pre-defined classes
2015-11-21 17:39:40 +08:00
2015-11-16 13:40:19 +08:00
### Hotkeys
2015-11-21 00:26:00 +08:00
* Ctrl + r : Change the defult target dir which saving annotation files
2015-11-16 13:40:19 +08:00
* Ctrl + n : Create a bounding box
* Ctrl + s : Save
* n : Next image
2015-11-21 17:39:40 +08:00
2015-11-22 16:57:50 +08:00
* p : Previous image
2015-11-23 14:21:55 +08:00
### How to contribute
2016-04-01 09:45:35 +08:00
Send a pull request
2016-04-11 17:18:33 +08:00
### License
[License ](LICENSE.md )
2016-05-10 22:42:13 +08:00