Kentaro Wada 5c9808446a Format code with black 4 years ago
..
.readme 3253db7859 Add labelme_draw_label_png 7 years ago
apc2016_obj3_json 83dfab0e14 Update examples/tutorial 5 years ago
README.md 179637bbd8 Update examples/tutorial/README.md 6 years ago
apc2016_obj3.jpg 37c8d48117 single_image -> tutorial 7 years ago
apc2016_obj3.json 61f5fee418 Remove lineColor and shapeColor keys from example JSON files 5 years ago
load_label_png.py 5c9808446a Format code with black 4 years ago

README.md

Tutorial (Single Image Example)

Annotation

labelme apc2016_obj3.jpg -O apc2016_obj3.json

Visualization

To view the json file quickly, you can use utility script:

labelme_draw_json apc2016_obj3.json

Convert to Dataset

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

labelme_json_to_dataset apc2016_obj3.json -o apc2016_obj3_json

It generates standard files from the JSON file.

How to load label PNG file?

Note that loading label.png is a bit difficult (scipy.misc.imread, skimage.io.imread may not work correctly), and please use PIL.Image.open to avoid unexpected behavior:

# see load_label_png.py also.
>>> import numpy as np
>>> import PIL.Image

>>> label_png = 'apc2016_obj3_json/label.png'
>>> lbl = np.asarray(PIL.Image.open(label_png))
>>> print(lbl.dtype)
dtype('uint8')
>>> np.unique(lbl)
array([0, 1, 2, 3], dtype=uint8)
>>> lbl.shape
(907, 1210)

Also, you can see the label PNG file by:

labelme_draw_label_png apc2016_obj3_json/label.png