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

K
Kentaro Wada 已提交
4
[![](https://badge.fury.io/gh/wkentaro%2Flabelme.svg)](https://badge.fury.io/gh/wkentaro%2Flabelme)
K
Kentaro Wada 已提交
5
[![Build Status](https://travis-ci.org/wkentaro/labelme.svg?branch=master)](https://travis-ci.org/wkentaro/labelme)
K
Kentaro Wada 已提交
6
[![Docker Build Status](https://img.shields.io/docker/build/wkentaro/labelme.svg)](https://hub.docker.com/r/wkentaro/labelme)
K
Kentaro Wada 已提交
7 8


K
Kentaro Wada 已提交
9 10 11 12 13 14 15 16
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
------------

K
Kentaro Wada 已提交
17
- [PyQt4 or PyQt5](http://www.riverbankcomputing.co.uk/software/pyqt/intro)
K
Kentaro Wada 已提交
18 19 20 21 22


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

K
Kentaro Wada 已提交
23 24
**Docker**

K
Kentaro Wada 已提交
25
You need install [docker](https://www.docker.com), then just run below:
K
Kentaro Wada 已提交
26 27 28 29 30 31

```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 已提交
32
./labelme_on_docker static/apc2016_obj3.jpg -O static/apc2016_obj3.json
K
Kentaro Wada 已提交
33
```
K
Kentaro Wada 已提交
34 35

**Ubuntu**
K
Kentaro Wada 已提交
36 37

```bash
K
Kentaro Wada 已提交
38 39
sudo apt-get install python-qt4 pyqt4-dev-tools
sudo pip install labelme
K
Kentaro Wada 已提交
40 41
```

K
Kentaro Wada 已提交
42
**macOS (older than Sierra)**
K
Kentaro Wada 已提交
43 44

```bash
K
Kentaro Wada 已提交
45 46
brew install qt qt4
pip install labelme
K
Kentaro Wada 已提交
47 48
```

K
Kentaro Wada 已提交
49
**macOS Sierra**
K
Kentaro Wada 已提交
50 51

```bash
K
Kentaro Wada 已提交
52
brew install pyqt
K
Kentaro Wada 已提交
53
pip install labelme
K
Kentaro Wada 已提交
54 55
```

K
Kentaro Wada 已提交
56 57 58 59

Usage
-----

K
Kentaro Wada 已提交
60 61
**Annotation**

K
Kentaro Wada 已提交
62 63
Run `labelme --help` for detail.

K
Kentaro Wada 已提交
64
```bash
K
Kentaro Wada 已提交
65
labelme  # Open GUI
K
Kentaro Wada 已提交
66 67
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 已提交
68 69
```

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

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

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

```bash
K
Kentaro Wada 已提交
78
labelme_draw_json static/apc2016_obj3.json
K
Kentaro Wada 已提交
79 80 81 82 83 84 85 86
```

**Convert to Dataset**

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


```bash
K
Kentaro Wada 已提交
87
labelme_json_to_dataset static/apc2016_obj3.json
K
Kentaro Wada 已提交
88 89 90 91 92 93
```


Sample
------

K
Kentaro Wada 已提交
94 95 96 97
- [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 已提交
98 99 100 101 102


Screencast
----------

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