README.md 3.1 KB
Newer Older
K
Kentaro Wada 已提交
1 2
<img src="https://github.com/wkentaro/labelme/blob/master/labelme/icons/icon.png?raw=true" align="right" />

K
Kentaro Wada 已提交
3 4 5
labelme: Image Annotation Tool with Python
==========================================

K
Kentaro Wada 已提交
6
[![PyPI Version](https://img.shields.io/pypi/v/labelme.svg)](https://pypi.python.org/pypi/labelme)
K
Kentaro Wada 已提交
7 8
[![Travis Build Status](https://travis-ci.org/wkentaro/labelme.svg?branch=master)](https://travis-ci.org/wkentaro/labelme)
[![Appveyor Build status](https://ci.appveyor.com/api/projects/status/epxf9b6c47cw373y/branch/master?svg=true)](https://ci.appveyor.com/project/wkentaro/labelme/branch/master)
K
Kentaro Wada 已提交
9
[![Docker Build Status](https://img.shields.io/docker/build/wkentaro/labelme.svg)](https://hub.docker.com/r/wkentaro/labelme)
K
Kentaro Wada 已提交
10 11


K
Kentaro Wada 已提交
12
Labelme is a graphical image annotation tool inspired by <http://labelme.csail.mit.edu>.  
K
Kentaro Wada 已提交
13 14 15
It is written in Python and uses Qt for its graphical interface.


K
Kentaro Wada 已提交
16
Requirements
K
Kentaro Wada 已提交
17 18
------------

K
Kentaro Wada 已提交
19 20
- Ubuntu / macOS / Windows
- Python2 / Python3
K
Kentaro Wada 已提交
21
- [PyQt4 / PyQt5](http://www.riverbankcomputing.co.uk/software/pyqt/intro)
K
Kentaro Wada 已提交
22 23 24 25 26


Installation
------------

K
Kentaro Wada 已提交
27 28 29 30 31
There are options:

- Platform agonistic installation: Anaconda, Docker
- Platform specific installation: Ubuntu, macOS

K
Kentaro Wada 已提交
32 33 34 35 36 37 38 39 40 41 42
**Anaconda**

You need install [Anaconda](https://www.continuum.io/downloads), then run below:

```bash
conda create --name=labelme python=2.7
source activate labelme
conda install pyqt
pip install labelme
```

K
Kentaro Wada 已提交
43 44
**Docker**

K
Kentaro Wada 已提交
45
You need install [docker](https://www.docker.com), then run below:
K
Kentaro Wada 已提交
46 47 48 49 50 51

```bash
wget https://raw.githubusercontent.com/wkentaro/labelme/master/scripts/labelme_on_docker
chmod u+x labelme_on_docker

# Maybe you need http://sourabhbajaj.com/blog/2017/02/07/gui-applications-docker-mac/ on macOS
K
Kentaro Wada 已提交
52
./labelme_on_docker static/apc2016_obj3.jpg -O static/apc2016_obj3.json
K
Kentaro Wada 已提交
53
```
K
Kentaro Wada 已提交
54 55

**Ubuntu**
K
Kentaro Wada 已提交
56 57

```bash
K
Kentaro Wada 已提交
58 59
sudo apt-get install python-qt4 pyqt4-dev-tools
sudo pip install labelme
K
Kentaro Wada 已提交
60 61
```

K
Kentaro Wada 已提交
62
**macOS**
K
Kentaro Wada 已提交
63 64

```bash
K
Kentaro Wada 已提交
65
brew install qt qt4 || brew install pyqt  # qt4 is deprecated
K
Kentaro Wada 已提交
66
pip install labelme
K
Kentaro Wada 已提交
67 68
```

K
Kentaro Wada 已提交
69 70 71 72

Usage
-----

K
Kentaro Wada 已提交
73 74
**Annotation**

K
Kentaro Wada 已提交
75 76
Run `labelme --help` for detail.

K
Kentaro Wada 已提交
77
```bash
K
Kentaro Wada 已提交
78
labelme  # Open GUI
K
Kentaro Wada 已提交
79 80
labelme static/apc2016_obj3.jpg  # Specify file
labelme static/apc2016_obj3.jpg -O static/apc2016_obj3.json  # Close window after the save
K
Kentaro Wada 已提交
81 82
```

K
Kentaro Wada 已提交
83 84 85
The annotations are saved as a [JSON](http://www.json.org/) file. The
file includes the image itself.

K
Kentaro Wada 已提交
86 87
**Visualization**

K
Kentaro Wada 已提交
88 89 90
To view the json file quickly, you can use utility script:

```bash
K
Kentaro Wada 已提交
91
labelme_draw_json static/apc2016_obj3.json
K
Kentaro Wada 已提交
92 93 94 95 96 97 98 99
```

**Convert to Dataset**

To convert the json to set of image and label, you can run following:


```bash
K
Kentaro Wada 已提交
100
labelme_json_to_dataset static/apc2016_obj3.json
K
Kentaro Wada 已提交
101 102 103 104 105 106
```


Sample
------

K
Kentaro Wada 已提交
107 108 109 110
- [Original Image](https://github.com/wkentaro/labelme/blob/master/static/apc2016_obj3.jpg)
- [Screenshot](https://github.com/wkentaro/labelme/blob/master/static/apc2016_obj3_screenshot.jpg)
- [Generated Json File](https://github.com/wkentaro/labelme/blob/master/static/apc2016_obj3.json)
- [Visualized Json File](https://github.com/wkentaro/labelme/blob/master/static/apc2016_obj3_draw_json.jpg)
K
Kentaro Wada 已提交
111 112 113 114 115


Screencast
----------

K
Kentaro Wada 已提交
116
<img src="https://github.com/wkentaro/labelme/raw/master/static/screencast.gif" width="70%"/>