Package: labelImg
LabelImgLabelImg is a graphical image annotation tool.It is written in Python and uses Qt for its graphical interface.Annotations are saved as XML files in PASCAL VOC format, the format used
byImageNet.  Besides, it also supports YOLO and CreateML formats.Watch a demo videoInstallationGet from PyPI but only python3.0 or aboveThis is the simplest (one-command) install method on modern Linux distributions such as Ubuntu and Fedora.pip3installlabelImglabelImglabelImg[IMAGE_PATH][PRE-DEFINEDCLASSFILE]Build from sourceLinux/Ubuntu/Mac requires at leastPython
2.6and has been tested withPyQt
4.8. However,Python
3 or aboveandPyQt5are strongly recommended.Ubuntu LinuxPython 3 + Qt5sudoapt-getinstallpyqt5-dev-toolssudopip3install-rrequirements/requirements-linux-python3.txtmakeqt5py3python3labelImg.pypython3labelImg.py[IMAGE_PATH][PRE-DEFINEDCLASSFILE]macOSPython 3 + Qt5brewinstallqt# Install qt-5.x.x by Homebrewbrewinstalllibxml2orusingpippip3installpyqt5lxml# Install qt and lxml by pipmakeqt5py3python3labelImg.pypython3labelImg.py[IMAGE_PATH][PRE-DEFINEDCLASSFILE]Python 3 Virtualenv (Recommended)Virtualenv can avoid a lot of the QT / Python version issuesbrewinstallpython3pip3installpipenvpipenvrunpipinstallpyqt5==5.15.2lxmlpipenvrunmakeqt5py3pipenvrunpython3labelImg.py[Optional]rm-rfbuilddist;pythonsetup.pypy2app-A;mv"dist/labelImg.app"/ApplicationsNote: The Last command gives you a nice .app file with a new SVG Icon in your /Applications folder. You can consider using the script: build-tools/build-for-macos.shWindowsInstallPython,PyQt5andinstall lxml.Open cmd and go to thelabelImgdirectorypyrcc4-olibs/resources.pyresources.qrcForpyqt5,pyrcc5-olibs/resources.pyresources.qrcpythonlabelImg.pypythonlabelImg.py[IMAGE_PATH][PRE-DEFINEDCLASSFILE]Windows + AnacondaDownload and installAnaconda(Python 3+)Open the Anaconda Prompt and go to thelabelImgdirectorycondainstallpyqt=5condainstall-canacondalxmlpyrcc5-olibs/resources.pyresources.qrcpythonlabelImg.pypythonlabelImg.py[IMAGE_PATH][PRE-DEFINEDCLASSFILE]Use Dockerdockerrun-it\--user$(id-u)\-eDISPLAY=unix$DISPLAY\--workdir=$(pwd)\--volume="/home/$USER:/home/$USER"\--volume="/etc/group:/etc/group:ro"\--volume="/etc/passwd:/etc/passwd:ro"\--volume="/etc/shadow:/etc/shadow:ro"\--volume="/etc/sudoers.d:/etc/sudoers.d:ro"\-v/tmp/.X11-unix:/tmp/.X11-unix\tzutalin/py2qt4makeqt4py2;./labelImg.pyYou can pull the image which has all of the installed and required dependencies.Watch a demo videoUsageSteps (PascalVOC)Build and launch using the instructions above.Click ‘Change default saved annotation folder’ in Menu/FileClick ‘Open Dir’Click ‘Create RectBox’Click and release left mouse to select a region to annotate the rect
boxYou can use right mouse to drag the rect box to copy or move itThe annotation will be saved to the folder you specify.You can refer to the below hotkeys to speed up your workflow.Steps (YOLO)Indata/predefined_classes.txtdefine the list of classes that will be used for your training.Build and launch using the instructions above.Right below “Save” button in the toolbar, click “PascalVOC” button to switch to YOLO format.You may use Open/OpenDIR to process single or multiple images. When finished with a single image, click save.A txt file of YOLO format will be saved in the same folder as your image with same name. A file named “classes.txt” is saved to that folder too. “classes.txt” defines the list of class names that your YOLO label refers to.Note:Your label list shall not change in the middle of processing a list of images. When you save an image, classes.txt will also get updated, while previous annotations will not be updated.You shouldn’t use “default class” function when saving to YOLO format, it will not be referred.When saving as YOLO format, “difficult” flag is discarded.Create pre-defined classesYou can edit thedata/predefined_classes.txtto load pre-defined classesHotkeysCtrl + uLoad all of the images from a directoryCtrl + rChange the default annotation target dirCtrl + sSaveCtrl + dCopy the current label and rect boxCtrl + Shift + dDelete the current imageSpaceFlag the current image as verifiedwCreate a rect boxdNext imageaPrevious imagedelDelete the selected rect boxCtrl++Zoom inCtrl–Zoom out↑→↓←Keyboard arrows to move selected rect boxVerify 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.Difficult:The difficult field is set to 1 indicates that the object has been annotated as “difficult”, for example, an object which is clearly visible but difficult to recognize without substantial use of context.
According to your deep neural network implementation, you can include or exclude difficult objects during training.How to reset the settingsIn case there are issues with loading the classes, you can either:From the top menu of the labelimg click on Menu/File/Reset AllRemove the.labelImgSettings.pklfrom your home directory. In Linux and Mac you can do:rm ~/.labelImgSettings.pklHow to contributeSend a pull requestLicenseFree software: MIT licenseCitation: Tzutalin. LabelImg. Git code (2015).https://github.com/tzutalin/labelImgRelated and additional toolsImageNet Utilsto
download image, create a label text for machine learning, etcUse Docker to run labelImgGenerating the PASCAL VOC TFRecord filesApp Icon based on Icon by Nick Roach (GPL)Setup python development in vscodeThe link of this project on iHub platformConvert annotation files to CSV format or format for Google Cloud AutoMLStargazers over timeHistory1.8.6 (2021-10-10)Display box width and height1.8.5 (2021-04-11)Merged a couple of PRsFixed issuesSupport CreateML format1.8.4 (2020-11-04)Merged a couple of PRsFixed issues1.8.2 (2018-12-02)Fix pip depolyment issue1.8.1 (2018-12-02)Fix issuesSupport zh-Tw strings1.8.0 (2018-10-21)Support drawing sqaure rectAdd item single click slotFix issues1.7.0 (2018-05-18)Support YOLOFix minor issues1.6.1 (2018-04-17)Fix issue1.6.0 (2018-01-29)Add more pre-defined labelsShow cursor pose in status barFix minor issues1.5.2 (2017-10-24)Assign different colors to different lablels1.5.1 (2017-9-27)Show a autosaving dialog1.5.0 (2017-9-14)Fix the issuesAdd feature: Draw a box easier1.4.3 (2017-08-09)Refactor settingFix the issues1.4.0 (2017-07-07)Add feature: auto savingAdd feature: single class modeFix the issues1.3.4 (2017-07-07)Fix issues and improve zoom-in1.3.3 (2017-05-31)Fix issues1.3.2 (2017-05-18)Fix issues1.3.1 (2017-05-11)Fix issues1.3.0 (2017-04-22)Fix issuesAdd difficult tagCreate new files for pypi1.2.3 (2017-04-22)Fix issues1.2.2 (2017-01-09)Fix issues