Kentaro Wada f4dfc47a55 Add labelme2coco.py for instance_segmentation 6 年之前
..
.readme 4d4d26ef04 Update README.md 6 年之前
data_annotated 4f2e652483 Add examples/instance_segmentation 7 年之前
data_dataset_coco f4dfc47a55 Add labelme2coco.py for instance_segmentation 6 年之前
data_dataset_voc eb58e964e3 Add labelme.utils.lblsave 6 年之前
README.md f4dfc47a55 Add labelme2coco.py for instance_segmentation 6 年之前
labelme2coco.py f4dfc47a55 Add labelme2coco.py for instance_segmentation 6 年之前
labelme2voc.py d4d5c8099f Fix for flake8 6 年之前
labels.txt 4f2e652483 Add examples/instance_segmentation 7 年之前

README.md

Instance Segmentation Example

Annotation

labelme data_annotated --labels labels.txt --nodata

Convert to VOC-like Dataset

# It generates:
#   - data_dataset_voc/JPEGImages
#   - data_dataset_voc/SegmentationClass
#   - data_dataset_voc/SegmentationClassVisualization
#   - data_dataset_voc/SegmentationObject
#   - data_dataset_voc/SegmentationObjectVisualization
./labelme2voc.py data_annotated data_dataset_voc --labels labels.txt


Fig 1. JPEG image (left), JPEG class label visualization (center), JPEG instance label visualization (right)

Note that the label file contains only very low label values (ex. 0, 4, 14), and 255 indicates the __ignore__ label value (-1 in the npy file).
You can see the label PNG file by following.

labelme_draw_label_png data_dataset_voc/SegmentationClassPNG/2011_000003.png   # left
labelme_draw_label_png data_dataset_voc/SegmentationObjectPNG/2011_000003.png  # right

Convert to COCO-like Dataset

# It generates:
#   - data_dataset_coco/JPEGImages
#   - data_dataset_coco/annotations.json
./labelme2coco.py data_annotated data_dataset_coco --labels labels.txt