• Stars
    star
    10,986
  • Rank 3,071 (Top 0.07 %)
  • Language
    Python
  • License
    Other
  • Created over 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Image Polygonal Annotation with Python (polygon, rectangle, circle, line, point and image-level flag annotation).


labelme

Image Polygonal Annotation with Python


Description

Labelme is a graphical image annotation tool inspired by http://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).

Features

Requirements

Installation

There are options:

Anaconda

You need install Anaconda, then run below:

# python3
conda create --name=labelme python=3
source activate labelme
# conda install -c conda-forge pyside2
# conda install pyqt
# pip install pyqt5  # pyqt5 can be installed via pip on python3
pip install labelme
# or you can install everything by conda command
# conda install labelme -c conda-forge

Ubuntu

sudo apt-get install labelme

# or
sudo pip3 install labelme

# or install standalone executable from:
# https://github.com/wkentaro/labelme/releases

macOS

brew install pyqt  # maybe pyqt5
pip install labelme

# or
brew install wkentaro/labelme/labelme  # command line interface
# brew install --cask wkentaro/labelme/labelme  # app

# or install standalone executable/app from:
# https://github.com/wkentaro/labelme/releases

Windows

Install Anaconda, then in an Anaconda Prompt run:

conda create --name=labelme python=3
conda activate labelme
pip install labelme

# or install standalone executable/app from:
# https://github.com/wkentaro/labelme/releases

Usage

Run labelme --help for detail.
The annotations are saved as a JSON file.

labelme  # just open gui

# tutorial (single image example)
cd examples/tutorial
labelme apc2016_obj3.jpg  # specify image file
labelme apc2016_obj3.jpg -O apc2016_obj3.json  # close window after the save
labelme apc2016_obj3.jpg --nodata  # not include image data but relative image path in JSON file
labelme apc2016_obj3.jpg \
  --labels highland_6539_self_stick_notes,mead_index_cards,kong_air_dog_squeakair_tennis_ball  # specify label list

# semantic segmentation example
cd examples/semantic_segmentation
labelme data_annotated/  # Open directory to annotate all images in it
labelme data_annotated/ --labels labels.txt  # specify label list with a file

For more advanced usage, please refer to the examples:

Command Line Arguments

  • --output specifies 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 --config flag.
  • Without the --nosortlabels flag, 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. Example
  • Labels are assigned to a single polygon. Example

FAQ

Developing

git clone https://github.com/wkentaro/labelme.git
cd labelme

# Install anaconda3 and labelme
curl -L https://github.com/wkentaro/dotfiles/raw/main/local/bin/install_anaconda3.sh | bash -s .
source .anaconda3/bin/activate
pip install -e .

How to build standalone executable

Below shows how to build the standalone executable on macOS, Linux and Windows.

# Setup conda
conda create --name labelme python=3.9
conda activate labelme

# Build the standalone executable
pip install .
pip install 'matplotlib<3.3'
pip install pyinstaller
pyinstaller labelme.spec
dist/labelme --version

How to contribute

Make sure below test passes on your environment.
See .github/workflows/ci.yml for more detail.

pip install -r requirements-dev.txt

flake8 .
black --line-length 79 --check labelme/
MPLBACKEND='agg' pytest -vsx tests/

Acknowledgement

This repo is the fork of mpitid/pylabelme.

More Repositories

1

gdown

Download a large file from Google Drive (curl/wget fails because of the security notice).
Python
3,407
star
2

pytorch-fcn

PyTorch Implementation of Fully Convolutional Networks. (Training code to reproduce the original result is available.)
Python
1,695
star
3

pytorch-for-numpy-users

PyTorch for Numpy users. https://pytorch-for-numpy-users.wkentaro.com
HTML
660
star
4

imgviz

Image Visualization Tools (object detection, semantic and instance segmentation)
Python
232
star
5

morefusion

MoreFusion: Multi-object Reasoning for 6D Pose Estimation from Volumetric Fusion, CVPR 2020
Python
227
star
6

fcn

Chainer Implementation of Fully Convolutional Networks. (Training code to reproduce the original result is available.)
Python
218
star
7

video-cli

Command line tools for quick video editing.
Python
121
star
8

gshell

Navigate in Google Drive as you do on shell (gshell = Google Drive + Shell).
Python
102
star
9

octomap-python

Python binding of the OctoMap library.
Cython
71
star
10

call-python-from-cpp

Example Code of Calling Python from C++ with PyBind11.
C++
57
star
11

chainer-mask-rcnn

Chainer Implementation of Mask R-CNN. (Training code to reproduce the original result is available.)
Python
55
star
12

reorientbot

ReorientBot: Learning Object Reorientation for Specific-Posed Placement, ICRA 2022
Python
49
star
13

safepicking

SafePicking: Learning Safe Object Extraction via Object-Level Mapping, ICRA 2022
Python
48
star
14

pascal3d

Toolkit for PASCAL3D dataset.
Python
32
star
15

dotfiles

My dotfiles.
Shell
31
star
16

conque.vim

[MIRROR] Run interactive commands inside a Vim buffer.
Python
23
star
17

moviepy-cli

Command line interface for MoviePy.
Python
23
star
18

logboard

logboard: Monitor and Compare Logs on Browser/Terminal.
Python
21
star
19

label-fusion

Volumetric Fusion of Multiple Semantic Labels and Masks
C++
19
star
20

jqk

Render a JSON with jq patterns.
Rust
16
star
21

github2pypi

Release tools from GitHub to PyPi.
Python
14
star
22

imgviz-cpp

Image Visualization Tools for C++
C++
13
star
23

hrp2_apc

3D Object Segmentation for Shelf Bin Picking by Humanoid with Deep Learning and Occupancy Voxel Grid Map (Humanoids2016)
Common Lisp
12
star
24

chainer-cyclegan

Chainer implementation of "Unpaired Image-to-Image Translation using Cycle-Consistent Adversarial Network".
Python
10
star
25

sdf-object-model-descriptor

Python
8
star
26

screenshot-manager

Organize screenshot/screencast in a uniform manner.
Python
7
star
27

pytorch-fc-densenet

Python
7
star
28

chainer-bicyclegan

Chainer implementation of "Toward Multimodal Image-to-Image Translation".
Python
7
star
29

rfcn

Recurrent Fully Convolutional Networks for Instance-level Object Segmentation.
Python
7
star
30

pycd

`cd` to python modules.
Python
7
star
31

homebrew-trr

[DEPRECATED] TRR (typing software on Emacs) as formula for Homebrew.
Ruby
5
star
32

vgg16

VGG16 object recognition network. (Chainer Implementation)
Python
5
star
33

apc-object-detection

Object detection for Amazon Picking Challenge.
Python
5
star
34

cython_catkin_example

Simple example of Catkin + Cython.
CMake
5
star
35

real-harem

Transgender of real persons to achieve real harem, with mixed reality on Hololens.
Python
4
star
36

label_octomap

Probabilistic 3D Multilabel Real-time Mapping for Multi-object Manipulation (IROS2017)
Python
4
star
37

gotenshita

See Gotenshita(御殿下) court open status.
Python
4
star
38

togif

Moved to https://github.com/wkentaro/video-cli
Python
4
star
39

chainer-modelzoo

Model-Zoo for Chainer.
Python
4
star
40

covid-vs-vaccine-mortality-japan

コロナ罹患とワクチン接種の死亡率比較
Python
3
star
41

imgviz_ros

Python
3
star
42

Install-trr

Installation script for TRR (typing software on Emacs) on Ubuntu.
Shell
3
star
43

jsk_201604_cmo

Catch Moving Object (CMO) task project from April 2016.
Python
3
star
44

lecture2017s-agent-system

2
star
45

wstool_cd

`cd` to repos in workspace managed by wstool.
Python
2
star
46

python-packages

Python
2
star
47

continuous_teaching

CMake
2
star
48

wkentaro.github.io

My personal page.
HTML
2
star
49

ros-tips

Tips to be left as written text.
2
star
50

CV

My curriculum vitae (CV).
TeX
2
star
51

jqk-python

Render a JSON with jq patterns. Faster version in Rust -> https://github.com/wkentaro/jqk
Python
2
star
52

lecture2014w-utmi-intelligent-mechano-informatics

Assignments of Intelligent Mechano Informatics lesson.
Python
2
star
53

convenience_store_objects

CMake
2
star
54

lecture2016a-aai-ist

Jupyter Notebook
2
star
55

homebrew-labelme

Homebrew installation of labelme.
Ruby
2
star
56

pytorch-vgg

Python
2
star
57

jsk_20160407_evaluate_realsense

Shell
1
star
58

jsk_20160405_vacuum2015_graspability

Python
1
star
59

apc-object-detection-old

Python
1
star
60

trimesh-glooey

Python
1
star
61

tensorflow-fcn

Python
1
star
62

google-calendar-manager

Python
1
star
63

auto-argcomplete

🐍 Auto argument completion util for human.
Python
1
star
64

hackerrank

Python
1
star
65

smile-of-the-day

Python
1
star
66

mysite.com

django tutorial package (mysite.com)
Python
1
star
67

d-image-pipeline

Python
1
star
68

logcal

CSS
1
star
69

lecture2016w-advanced-statistical-modeling-report

TeX
1
star
70

acml-paper-template

TeX
1
star
71

euspy

Common Lisp
1
star
72

lecture2017s-image-system

C++
1
star
73

multisettings

Tool to handle multiple settings for editor, shell and other command line tools.
Python
1
star
74

reference

Python
1
star
75

octomap-python-wheels

Build wheels for wkentaro/octomap-python.
Shell
1
star
76

personal-notes

My personal notes.
Python
1
star
77

awesome-eus

A curated list of awesome Euslisp documents, functions and macros.
Common Lisp
1
star
78

cython-tutorials

Python
1
star
79

citations

[DEPRECATED] My citations.
TeX
1
star
80

jsk-data-aries-scripts

Shell
1
star
81

dakoku

dakoku
Python
1
star
82

apc-data

Python
1
star
83

gci-case-study

Case Study in GCI, which is a program improving the skills of analyzing big data.
Python
1
star
84

jsk_20160505_test_message_filters

Testing message_filters Python interface in JSK on May 5th in 2016.
Python
1
star
85

wstool_catkin

catkin env hooks providing bash completion and setting ROS_WORKSPACE in devel space
EmberScript
1
star
86

lecture2014s-utmech-soft2

Sample codes in "ソフトウェア第二", which is a class about software engineering in UTokyo.
Python
1
star
87

homebrew-pycd

Homebrew tap repository for wkentaro/pycd.
Ruby
1
star
88

Introduction2Algorithms

Python
1
star
89

utaskweb_syllabus

crawling the contents in UTask-Web
Python
1
star
90

eus-for-pythonista

Common Lisp
1
star
91

test-euslisp-in-package

Common Lisp
1
star
92

lora

Hubot named lora, who is working in JSK Robotics Team.
CoffeeScript
1
star
93

ros_fcn_3d

Python
1
star
94

ros-pkg

Python
1
star
95

bibtex

TeX
1
star
96

py-fast-rcnn

Python
1
star
97

jsk_20160228_evaluate_pick_and_verify

Python
1
star
98

ros_beginner_tutorials

ROS pakage for beginners served at http://wiki.ros.org.
Python
1
star
99

effective-python

Python
1
star
100

lecture2016w-practical-english-ii-report

TeX
1
star