Ashish-Surve / Comparison_Segmentation_models

Brief comparison of segmentation models. Trained on Collab, served using Fast-API, streamlit and dockerized.

Home Page:https://frontend-seg-models.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Segmentation Comparison tool

This tools helps us to compare different segmentation models.

Brief comparsion of segmentation models. Trained on collab for car/vehicle segmentation.

Live Demo

Tools used

FastAPI: for the API
streamlit : for the interface
Docker: to containerize the app

Every star will help me to gather motivation to make this project even more accesible to world.

Examples

Web Application

Initially created a model with 5 epochs => 5 minutes of training on collab at max capacity.

Input / Output Unet efficientNet

Training Information:

Compartive Analysis:

Model / Metric Loss Mean-IoU Mean-f1
U-net 0.6846 52.08 % 63.11 %
FPN 0.3300 68.33 % 77.37 %
LinkNet 0.9490 33.64 % 44.37 %

gt mask= generated Mask / pr mask = Predicted Mask

Unet

Unet-graph

Unet-1 Unet-2 Unet-3

FPN

FPN-graph

FPN-1 FPN-2 FPN-3

LinkNet

LinkNet-graph

LinkNet-1 LinkNet-2 LinkNet-3

Folder Structure:

Comparsion_Segmentation_models/ 
    docker-                       compose.yml - for creating the containers and network in one go.
    backend/                      backend service that uses FASTAPI.
        config.py                 stores paths and dictionary for easy access.
        Dockerfile                instructions on how to build backend container.
        inference.py              does the inferencing for our segment models.
        main.py                   FASTAPI based backend server.
        requirements.txt          
        Try_backend.ipynb         initial trial at training models(ignore)
        try_code.ipynb            trial 2 at training models(ignore)
        models/                   3 trained models for cars segmentation. 
            FPN-efficientnet.h5
            LinkedNet.h5
            U-net-efficientnet.h5
        storage/                  frontend saves files here(DEBUG purpose).
    frontend/                     frontend that serves UI using streamlit.
        Dockerfile                instructions on how to build frontend container.
        main.py                   Streamlit based backend server.
        requirements.txt
    storage/                      shared directory for storing uploaded image.
    storage2/                     shared directory for storing segmented image.

TL;DR

  1. execute docker-compose up -d in root of repository
  2. open the http://localhost:8501/ or check the port of your frontend container using docker.

We will soon be adding the collab notebook if someone needs it.

About

Brief comparison of segmentation models. Trained on Collab, served using Fast-API, streamlit and dockerized.

https://frontend-seg-models.herokuapp.com/

License:GNU General Public License v3.0


Languages

Language:Python 95.0%Language:Dockerfile 3.9%Language:Makefile 1.0%