The model is a pretrained segmentation model that outputs a mask of size H=1024, W=2048
with integers of values in [0, ..., 19]
that represents the following classes :
- road
- sidewalk
- building
- wall
- fence
- pole
- traffic light
- traffic sign
- vegetation
- terrain
- sky
- person
- rider
- car
- truck
- bus
- train
- motorcycle
- bicycle
- ego-vehicle
https://docs.openvino.ai/latest/index.html
Openvino is a library developped by intel to optimize deeplearning computations on intel CPU and other equipement. For this application, openvino inference engine, as well and optimized segmentation model, where used to make the up lighteweighted and usable on any machine with intel x86 cpu architecture
Used weights are downloadable from here : https://download.01.org/opencv/2021/openvinotoolkit/2021.1/open_model_zoo/models_bin/1/semantic-segmentation-adas-0001/FP32/
Make sure you have a modern version of docker
(>1.13.0) and docker-compose
installed.
This repo contains a simple server client architecture to enable making image segmentation inferences through a simple webpage
├── README.md
├── backend
│ ├── Dockerfile
│ ├── legend.png
│ ├── main.py
│ ├── model_weights
│ │ ├── semantic-segmentation-adas-0001.bin
│ │ ├── semantic-segmentation-adas-0001.xml
│ │ └── semantic_segmentation.ipynb
│ ├── plot.py
│ ├── requirements.txt
│ ├── semantic_segmentation_model.py
│ └── test_main.py
├── docker-compose.yml
├── frontend
│ ├── Dockerfile
│ ├── main.py
│ └── requirements.txt
└── storage
To setup the app and run it, follow these steps
- Clone this repository
- access the repository then run the following command to build 2 docker images and compose them
docker-compose up -d
This might take some time inorder to build 2 docker images, one called backend
and the other one frontend
- Access the frontend webpage through the following url
http://0.0.0.0:8501/
Now you should have your docker containers up and running
The webapp is a simple app
Use the sidebar to upload and image
once an image is uploaded, it gets displayed for you
after that you can click on the button predict
to run your prediction
A onverlay of a predicted segmentation mask and and the input image
the api is set with FastAPI, and you can access the documentation on the following links