Kentaro Wada 397c94a2d4 Apply ruff to examples/ 1 an în urmă
..
.readme 03d7d365ce Update README images 5 ani în urmă
data_annotated 61f5fee418 Remove lineColor and shapeColor keys from example JSON files 5 ani în urmă
data_dataset_coco a8b94863d2 Add data_dataset_coco/Visualization 4 ani în urmă
data_dataset_voc aa91168e4c Export original VOC format in labelme2voc.py 1 an în urmă
README.md aa91168e4c Export original VOC format in labelme2voc.py 1 an în urmă
labelme2coco.py 397c94a2d4 Apply ruff to examples/ 1 an în urmă
labelme2voc.py d39ba17287 Sort json file processing in labelme2voc.py 1 an în urmă
labels.txt 4f2e652483 Add examples/instance_segmentation 7 ani în urmă

README.md

Instance Segmentation Example

Annotation

labelme data_annotated --labels labels.txt --nodata --validatelabel exact --config '{shift_auto_shape_color: -2}'
labelme data_annotated --labels labels.txt --nodata --labelflags '{.*: [occluded, truncated], person: [male]}'

Convert to VOC-format Dataset

# It generates:
#   - data_dataset_voc/JPEGImages
#   - data_dataset_voc/SegmentationClass
#   - data_dataset_voc/SegmentationClassNpy
#   - data_dataset_voc/SegmentationClassVisualization
#   - data_dataset_voc/SegmentationObject
#   - data_dataset_voc/SegmentationObjectNpy
#   - 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/SegmentationClass/2011_000003.png   # left
labelme_draw_label_png data_dataset_voc/SegmentationObject/2011_000003.png  # right

Convert to COCO-format Dataset

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