This repository contains a Python application that can be used to quickly generate labelled data for image segmentation tasks. The application can be run as a web service or command line tool and supports a number of algorithms to generate candidate image masks.
More detail on the approaches implemented in this repository is available in the companion Azure Notebook: Using Otsu's method to pre-label training data for image segmentation.
Pull and run the auto-labelling service via docker:
docker run -p 8080:80 cwolff/image_segmentation_auto_labels
This will start the auto-labelling service on port 8080. There are two main routes in the service:
# fetch a list of supported image masking algorithms
curl 'http://localhost:8080/algorithms'
# generate a mask for an image using the provided masking algorithm
curl 'http://localhost:8080/mask' -H 'Content-Type: application/json' -d '
{
"image_path": "/data/test_image.jpg",
"algorithm": "otsu_hue",
"morph": 0
}'
You can use the test page to interactively experiment with the service.
Pull and run the auto-labelling tool via docker:
# fetch a list of supported image masking algorithms
docker run cwolff/image_segmentation_auto_labels /do list_algorithms
# generate a mask for an image using the provided masking algorithm
docker run cwolff/image_segmentation_auto_labels /do create_mask "/data/test_image.jpg" "otsu_hue" "0"