README.md 2.2 KB
Newer Older
K
Kentaro Wada 已提交
1 2 3
labelme: Image Annotation Tool with Python
==========================================

K
Kentaro Wada 已提交
4 5 6
[![Build Status](https://travis-ci.org/wkentaro/labelme.svg?branch=master)](https://travis-ci.org/wkentaro/labelme)


K
Kentaro Wada 已提交
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
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.


Dependencies
------------

- [PyQt4](http://www.riverbankcomputing.co.uk/software/pyqt/intro)


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

On Ubuntu:

```bash
K
Kentaro Wada 已提交
24
sudo apt-get install python-qt4 pyqt4-dev-tools
K
Kentaro Wada 已提交
25

K
Kentaro Wada 已提交
26
sudo pip install labelme
K
Kentaro Wada 已提交
27 28 29 30 31
```

On OS X:

```bash
K
Kentaro Wada 已提交
32
brew install qt qt4
K
Kentaro Wada 已提交
33

K
Kentaro Wada 已提交
34
pip install labelme
K
Kentaro Wada 已提交
35 36
```

K
Kentaro Wada 已提交
37 38 39
On macOS Sierra:

```bash
K
Kentaro Wada 已提交
40
brew install pyqt5
K
Kentaro Wada 已提交
41

K
Kentaro Wada 已提交
42
pip install git+https://github.com/wkentaro/labelme.git@pyqt5
K
Kentaro Wada 已提交
43 44
```

K
Kentaro Wada 已提交
45 46 47 48 49
Docker:

You need install [docker](https://www.docker.com), and please follow below section
for usage of `labelme_draw_json`.

K
Kentaro Wada 已提交
50 51 52 53

Usage
-----

K
Kentaro Wada 已提交
54 55
**Annotation**

K
Kentaro Wada 已提交
56 57
Run `labelme --help` for detail.

K
Kentaro Wada 已提交
58
```bash
K
Kentaro Wada 已提交
59 60 61 62 63 64 65 66
labelme  # Open GUI
labelme _static/IMG_6319.jpg  # Specify file
labelme _static/IMG_6319.jpg -O _static/IMG_6319.json  # Close window after the save
```

If you are installed [docker](https://www.docker.com), you can run:

```bash
K
Kentaro Wada 已提交
67
# Maybe you need http://sourabhbajaj.com/blog/2017/02/07/gui-applications-docker-mac/ on macOS
K
Kentaro Wada 已提交
68
labelme_on_docker _static/IMG_6319.jpg -O _static/IMG_6319.json
K
Kentaro Wada 已提交
69 70 71 72 73
```

The annotations are saved as a [JSON](http://www.json.org/) file. The
file includes the image itself.

K
Kentaro Wada 已提交
74 75
**Visualization**

K
Kentaro Wada 已提交
76 77 78
To view the json file quickly, you can use utility script:

```bash
K
Kentaro Wada 已提交
79
labelme_draw_json _static/IMG_6319.json
K
Kentaro Wada 已提交
80 81 82 83 84 85 86 87
```

**Convert to Dataset**

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


```bash
K
Kentaro Wada 已提交
88
labelme_json_to_dataset _static/IMG_6319.json
K
Kentaro Wada 已提交
89 90 91 92 93 94
```


Sample
------

K
Kentaro Wada 已提交
95 96 97 98
- [Original Image](https://github.com/wkentaro/labelme/blob/master/_static/IMG_6319.jpg)
- [Screenshot](https://github.com/wkentaro/labelme/blob/master/_static/IMG_6319_screenshot.png)
- [Generated Json File](https://github.com/wkentaro/labelme/blob/master/_static/IMG_6319.json)
- [Visualized Json File](https://github.com/wkentaro/labelme/blob/master/_static/IMG_6319_draw_json.png)
K
Kentaro Wada 已提交
99 100 101 102 103


Screencast
----------

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