Skip to content

Image segmentation ML model deployed as RESTful API and packaged in a Docker container

Notifications You must be signed in to change notification settings

4ndrewparr/clarius-tha-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 

Repository files navigation

clarius-tha-1


Image segmentation ML model deployed as a RESTful API and packaged in a Docker container.

To build the API I used Flask and Flasgger with SwaggerUI. Flasgger allows us to automatically generate an interactive API documentation where one can try out API calls.

The semantic segmentation model deployed is a Fully-Convolutional Network model with a ResNet-50 backbone, pre-trained on the COCO train2017 dataset and containing the same classes as Pascal VOC (20).


Running the API from a Docker container:

  1. From the api folder, build the docker container image with:
$ docker image build -f Dockerfile.pytorch -t <image-name> .
  1. Run the container from the image created:
$ docker container run -d --rm -p 8888:8888 <image-name>
  1. Go to http://localhost:8888/apidocs/ to interact with the API. You can test POST calls with the sample images in this repository or uploading your own images.
api.mp4

Visualizing responses:

  • To visualize the outputted segmented image you can download the Response body (it downloads as a .txt file), and then pass it to the function response2img that you can find in utils.py.

results



About

Image segmentation ML model deployed as RESTful API and packaged in a Docker container

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages