Giter Site home page Giter Site logo

real-time-domain-adaptation-in-semantic-segmentation's Introduction

AML 2021/2022 "Real-time Domain Adaptation in Semantic Segmentation" Project

This folder contains the full code of the project for the final exam Advanced Machine Learning at Politecnico di Torino.
This contains:

  1. An implementation of a real-time semantic segmentation network, BiSeNet (Bilateral Segmentation Network), that can exploit two different backbones, ResNet-101 or ResNet-18;
  2. An implementation of an unsupervised adversarial domain adaptation algorithm;
  3. A variation of the unsupervised adversarial domain adaptation algorithm with lightweight depthwise-separable convolutions for the adversarial discriminator, which significantly reduce the total number of parameters and the total number of Floating Point Operations (FLOPS) of the model, making it suitable for mobile mobile and/or embedded devices;
  4. Two image-to-image transformations, to improve domain adaptation:
    • FDA;
    • LAB;
  5. Generation of pseudo-labels for the target domain, to further enhance domain adaptation.
  6. A combination of LAB transformation and pseudo labels generation for the target domain.

The network BiSeNet is based on pytorch 0.4.1 and python 3.6

The notebook "Real-time Domain Adaptation in Semantic Segmentation.ipynb" includes all the results, except for the last one that is the "Real-time Domain Adaptation in Semantic Segmentation.ipynb (2)" notebook

Train

  1. To train the the network BiSeNet:
python train.py
  1. To train the adversarial algorithm:
python trainGTAtoCityscapes.py
  1. To train using the lighweight discriminator:
python trainGTAtoCityscapes.py --use_DSC, 1
  1. To train applying the FDA transformation on source data:
python trainGTAtoCityscapes.py --use_DSC, 1 \
                               --transformation_on_source, FDA

To train applying the LAB transformation on source data:

python trainGTAtoCityscapes.py --use_DSC, 1 \
                               --transformation_on_source, LAB
  1. To train applying the the FDA transformation on source data:
python trainGTAtoCityscapesSSL.py 
                               
  1. To train applying the the FDA transformation on source data:
python trainGTAtoCityscapesSSL.py --transformation_on_source, LAB
                               

Test

To evaluate the BiSeNet model:

python eval.py

real-time-domain-adaptation-in-semantic-segmentation's People

Contributors

frarus avatar claudiotancredi avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.