Home

Awesome

GluonCv Semantic Segmentation Training GUI for Linux

This repository allows you to get started with training a State-of-the-art Deep Learning (DL) model for semantic segmentation with little to no configuration needed! You provide your labeled dataset and you can start the training right away. This repository is based on Gluoncv's Framework. You can check the networks statistics here

<br> <br>

Table of Contents

  1. Prerequisites
  2. How to check for prerequisites
  3. Installing Prerequisites
  4. Setting Up Project Requirements
    1. Validating the prerequisites installation
    2. Remark docker sdk port
  5. Label your own dataset
  6. Dataset Folder Structure
    1. objectclasses.json file example
  7. Light-weight Mid-weight and Heavy-weight Solution
  8. Build the Solution
    1. GPU build
    2. GPU with MKL support build
    3. CPU build
    4. CPU with MKL support build
  9. Run the Solution
    1. GPU run
    2. GPU with MKL support run
    3. CPU run
    4. CPU with MKL support run
  10. Usage
    1. Preparing Dataset
    2. Specifying General Settings
    3. Specifying Basic Hyper-parameters
    4. Specifying Advanced Hyper-parameters
    5. Checking training logs
    6. Stopping and Delete the model's container
    7. Testing the Model with Inference API
  11. Training Hyper Parameters
  12. Training Support Matrix
  13. Known Errors
  14. Acknowledgments

Prerequisites

<br>

How to check for prerequisites

To check if you have docker-ce installed:

docker --version

To check if you have docker-compose installed:

docker-compose --version

To check if you have Nvidia-docker installed:

dpkg -l | grep nvidia-docker

To check your Nvidia drivers version, open your terminal and type the command nvidia-smi

<br>

Installing Prerequisites

This step is very important and if not performed the solution will not work properly)**

Setting Up Project Requirements

This step is necessary to be able to run the solution correctly.

The setup script will adjust the base directory and the training docker image name needed to start a training container with the proper architecture (CPU/GPU)

<br>

Validating the prerequisites installation

Remark - docker sdk port

Docker SDK API uses the port 4222 to run. In case this port is used by another application. The API can be configured to run on a different port by doing the following steps:

After those modifications you should rebuild the solution for changes to take place.

Label your own dataset

To label your own dataset for semantic segmentation training, you can install the labelme labeling tool.

Make sure to convert the labels to the corresponding format required for the semantic segmentation workflow (Read the semantic segmentation labelme documentation)

JPEGImages and SegmentationClassPNG are the respective images and labels folders needed, place them in your project's repository.

Dataset Folder Structure

We offer a sample dataset to use for training. It's called "dummy_dataset". It has 3 classes : "background","pad","circle".

The following is an example of how a dataset should be structured. Please put all your datasets in the data folder.

├──datasets/
    ├──dummy_dataset/
        ├── images
        │   ├── img_1.jpg
        │   └── img_2.jpg
        ├── labels
        │   │── img_1.png
        │   │── img_2.png
        │── objectclasses.json


objectclasses.json file example

You must include in your dataset an objectclasses.json file with a similar structure to the example below:

Light-weight Mid-weight and Heavy-weight Solution

Lightweight (default mode): Building the docker image without pre-downloading any online pre-trained weights, the online weights will be downloaded when needed after running the image.

Midweight: Downloading specific supported online pre-trained weights during the docker image build.<br> To do that, open the JSON file training_api/assets/networks.json and change the values of the networks you wish to download to true.

Heavyweight: Downloading all the supported online pre-trained weights during the docker image build. <br> To do that, open the JSON file training_api/assets/networks.json and change the value of "select_all" to true.

Build the Solution

We offer Intel MKL support for both CPU and GPU version but please keep in mind the following:

You can also refer to training support matrix for more information.

<br> <br>

Run the Solution

Usage

<br>

1- Preparing Dataset

Prepare your dataset for training

<br>

2- Specifying General Settings

Specify the general parameters for your docker container

<br>

3- Specifying Basic Hyper-parameters

Specify the basic hyper-parameters for the training job

<br>

4- Specifying Advanced Hyper-parameters

Specify the advanced hyper-parameters for the training job

<br>

5- Checking training logs

Check your training logs to get better insights on the progress of the training. You can also download logs.

<br>

6- Stopping and Delete the model's container

Delete the container's job to stop an ongoing job or to remove the container of a finished job. (Finished jobs are always available to download)

7- Testing the Model with Inference API

You can test your trained model using the inference API provided

<br> <br>

Training Hyper Parameters

<br> <br>

Training Support Matrix

SolutionBuildTrainingNotes
GPUNormal build time and docker image sizenormal training timeBetter alternative if you are not planning on training using your CPU
GPU with Intel MKLLonger build time and larger docker image sizefaster training timewhen choosing CPU architecture in GUI only
CPUNormal build time and docker image sizenormal training timeBetter alternative if you want faster and lighter solution
CPU with Intel MKLLonger build time and larger docker image sizefaster training timeBetter alternative if you wish faster training time
<br> <br>

Known Errors

You might face some errors in some cases during the training. The most common ones are:

<br> <br>

Acknowledgments