Package: labelme-v0.1
labelmeImage Polygonal Annotation with PythonDescriptionLabelme is a graphical image annotation tool inspired byhttp://labelme.csail.mit.edu.It is written in Python and uses Qt for its graphical interface.VOC dataset example of instance segmentation.Other examples (semantic segmentation, bbox detection, and classification).Various primitives (polygon, rectangle, circle, line, and point).FeaturesImage annotation for polygon, rectangle, circle, line and point. (tutorial)Image flag annotation for classification and cleaning. (#166)Video annotation. (video annotation)GUI customization (predefined labels / flags, auto-saving, label validation, etc). (#144)Exporting VOC-format dataset for semantic/instance segmentation. (semantic segmentation,instance segmentation)Exporting COCO-format dataset for instance segmentation. (instance segmentation)RequirementsUbuntu / macOS / WindowsPython2 / Python3PyQt4 / PyQt5/PySide2InstallationThere are options:Platform agonistic installation:Anaconda,DockerPlatform specific installation:Ubuntu,macOS,WindowsAnacondaYou need installAnaconda, then run below:# python2condacreate--name=labelmepython=2.7sourceactivatelabelme# conda install -c conda-forge pyside2condainstallpyqt
pipinstalllabelme# if you'd like to use the latest version. run below:# pip install git+https://github.com/wkentaro/labelme.git# python3condacreate--name=labelmepython=3.6sourceactivatelabelme# conda install -c conda-forge pyside2# conda install pyqtpipinstallpyqt5# pyqt5 can be installed via pip on python3pipinstalllabelmeDockerYou need installdocker, then run below:wgethttps://raw.githubusercontent.com/wkentaro/labelme/master/labelme/cli/on_docker.py-Olabelme_on_docker
chmodu+xlabelme_on_docker# Maybe you need http://sourabhbajaj.com/blog/2017/02/07/gui-applications-docker-mac/ on macOS./labelme_on_dockerexamples/tutorial/apc2016_obj3.jpg-Oexamples/tutorial/apc2016_obj3.json
./labelme_on_dockerexamples/semantic_segmentation/data_annotatedUbuntu# Ubuntu 14.04 / Ubuntu 16.04# Python2# sudo apt-get install python-qt4  # PyQt4sudoapt-getinstallpython-pyqt5# PyQt5sudopipinstalllabelme# Python3sudoapt-getinstallpython3-pyqt5# PyQt5sudopip3installlabelmemacOS# macOS Sierrabrewinstallpyqt# maybe pyqt5pipinstalllabelme# both python2/3 should work# or install standalone executable / app# NOTE: this only installs the `labelme` commandbrewinstallwkentaro/labelme/labelme
brewcaskinstallwkentaro/labelme/labelmeWindowsFirstly, follow instruction inAnaconda.# Pillow 5 causes dll load error on Windows.# https://github.com/wkentaro/labelme/pull/174condainstallpillow=4.0.0UsageRunlabelme --helpfor detail.The annotations are saved as aJSONfile.labelme# just open gui# tutorial (single image example)cdexamples/tutorial
labelmeapc2016_obj3.jpg# specify image filelabelmeapc2016_obj3.jpg-Oapc2016_obj3.json# close window after the savelabelmeapc2016_obj3.jpg--nodata# not include image data but relative image path in JSON filelabelmeapc2016_obj3.jpg\--labelshighland_6539_self_stick_notes,mead_index_cards,kong_air_dog_squeakair_tennis_ball# specify label list# semantic segmentation examplecdexamples/semantic_segmentation
labelmedata_annotated/# Open directory to annotate all images in itlabelmedata_annotated/--labelslabels.txt# specify label list with a fileFor more advanced usage, please refer to the examples:Tutorial (Single Image Example)Semantic Segmentation ExampleInstance Segmentation ExampleVideo Annotation ExampleCommand Line Arguemnts--outputspecifies the location that annotations will be written to. If the location ends with .json, a single annotation will be written to this file. Only one image can be annotated if a location is specified with .json. If the location does not end with .json, the program will assume it is a directory. Annotations will be stored in this directory with a name that corresponds to the image that the annotation was made on.The first time you run labelme, it will create a config file in~/.labelmerc. You can edit this file and the changes will be applied the next time that you launch labelme. If you would prefer to use a config file from another location, you can specify this file with the--configflag.Without the--nosortlabelsflag, the program will list labels in alphabetical order. When the program is run with this flag, it will display labels in the order that they are provided.Flags are assigned to an entire image.ExampleLabels are assigned to a single polygon.ExampleFAQHow to convert JSON file to numpy array?Seeexamples/tutorial.How to load label PNG file?Seeexamples/tutorial.How to get annotations for semantic segmentation?Seeexamples/semantic_segmentation.How to get annotations for instance segmentation?Seeexamples/instance_segmentation.Testingpipinstallhackingpytestpytest-qt
flake8.
pytest-vtestsDevelopinggitclonehttps://github.com/wkentaro/labelme.gitcdlabelme# Install anaconda3 and labelmecurl-Lhttps://github.com/wkentaro/dotfiles/raw/master/local/bin/install_anaconda3.sh|bash-s.source.anaconda3/bin/activate
pipinstall-e.How to build standalone executableBelow shows how to build the standalone executable on macOS, Linux and Windows.Also, there are pre-built executables inthe release section.# Setup condacondacreate--namelabelmepython==3.6.0
condaactivatelabelme# Build the standalone executablepipinstall.
pipinstallpyinstaller
pyinstallerlabelme.spec
dist/labelme--versionAcknowledgementThis repo is the fork ofmpitid/pylabelme,
whose development has already stopped.Cite This ProjectIf you use this project in your research or wish to refer to the baseline results published in the README, please use the following BibTeX entry.@misc{labelme2016,author={KetaroWada},title={{labelme:ImagePolygonalAnnotationwithPython}},howpublished={\url{https://github.com/wkentaro/labelme}},year={2016}}