Giter VIP home page Giter VIP logo

few-shots-segmentation-domain-adaptation_'s Introduction

This project is about to apply the learning to learn method to solve the segmentation domain adaptation. Specifically,
we focus on semi-supervised domain adaptation (Few-shot learning). Our work is based on SegNet.
For presentation: please see https://docs.google.com/presentation/d/1e0X3vspJcGKNs_-wYLLRe-LuQ7j9IZzUUZOXBGoGcJo/edit#slide=id.g2b58be7c28_3_296

The overall procedure is as followed:
1. Obtain lots of pairs of classifiers from models learnt from small samples and those learnt from large samples in
    GTA5 dataset.
2. Train the regression network that maps the small sampled classifier to large sampled classifier.
3. Apply the regression network to the small sampled models learnt from Cityscape dataset to get the target models.

4. Learn a model to predict the overall layout distribution in GTA5 dataset.
5. Apply the "distribution prediction model" to cityscape dataset to obtain predicted distributions.

6. Train the final model using the constraints from Step 3 and Step 5.
7. Evaluate at Cityscape testing set.

Here are some details about how to run the program.

For Step 1, first train a lot of model pairs and then use "extract_classifier_from_caffemodel.py" to extract the
classifiers from the models.

For Step 2, it takes two stages to train the regression network. The first stage only minimise
the regression loss, while the second stage combining with the segmentation loss.
To train stage 1, run python train_regression_net_stage1.py --pair=model_pair.txt.
To train stage 2, run python train_regression_net_stage2.py --pair=model_pair_6.txt --regmodel=stage1.npy
                        --model=segnet_inference.prototxt --weights=test_weights.caffemodel

For step 3, train a lots of small sampled models in cityscape dataset. And then run
            "get_target_models_from_regression_net.py" to get the target models.
            python get_transformed_model.py --regmodel=stage2.npy --model=segnet_inference.prototxt
            --weights=segnet.caffemodel --folder=./target_weights/ --name=target.npy

For step 4, obtain the GT distribution first before running "train_layout_distribution_prediction.py"
            to train the distribution prediction model
For step 6, to make the data to fit into the gpu and increase the training speed, you might need to first extract
            features before the last classifier from caffemodel and store it using "extract_conv_features.py".
            After that, run python learning_to_learn_ds.py --f2gt=feature2GT.txt --conv=target.npy
            --name=final.npy --normal
For step 7, run python test.py --conv=final.npy --list=city_val_f2gt.txt --save=results/

28_16_50_1_2000_reg1.npy
28: total number of categories
16: current category
50: number of sample images
1: 1th sample
2000: iterations
reg1: small regularization

few-shots-segmentation-domain-adaptation_'s People

Contributors

its-dron avatar

Watchers

James Cloos avatar Xiaoyu Chen 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.