All Projects → CVLAB-Unibo → Real Time Self Adaptive Deep Stereo

CVLAB-Unibo / Real Time Self Adaptive Deep Stereo

Licence: apache-2.0
Code for "Real-time self-adaptive deep stereo" - CVPR 2019 (ORAL)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Real Time Self Adaptive Deep Stereo

DomainAdaptation
Domain Adaptation
Stars: ✭ 20 (-93.46%)
Mutual labels:  domain-adaptation
VirtualCapsuleEndoscopy
VR-Caps: A Virtual Environment for Active Capsule Endoscopy
Stars: ✭ 59 (-80.72%)
Mutual labels:  domain-adaptation
SHOT-plus
code for our TPAMI 2021 paper "Source Data-absent Unsupervised Domain Adaptation through Hypothesis Transfer and Labeling Transfer"
Stars: ✭ 46 (-84.97%)
Mutual labels:  domain-adaptation
pytorch-arda
A PyTorch implementation for Adversarial Representation Learning for Domain Adaptation
Stars: ✭ 49 (-83.99%)
Mutual labels:  domain-adaptation
domain-adaptation-capls
Unsupervised Domain Adaptation via Structured Prediction Based Selective Pseudo-Labeling
Stars: ✭ 43 (-85.95%)
Mutual labels:  domain-adaptation
weak-supervision-for-NER
Framework to learn Named Entity Recognition models without labelled data using weak supervision.
Stars: ✭ 114 (-62.75%)
Mutual labels:  domain-adaptation
bert-AAD
Adversarial Adaptation with Distillation for BERT Unsupervised Domain Adaptation
Stars: ✭ 27 (-91.18%)
Mutual labels:  domain-adaptation
robustness
Robustness and adaptation of ImageNet scale models. Pre-Release, stay tuned for updates.
Stars: ✭ 63 (-79.41%)
Mutual labels:  domain-adaptation
traditional-domain-adaptation-methods
traditional domain adaptation methods (e.g., GFK, TCA, SA)
Stars: ✭ 47 (-84.64%)
Mutual labels:  domain-adaptation
Meta-SelfLearning
Meta Self-learning for Multi-Source Domain Adaptation: A Benchmark
Stars: ✭ 157 (-48.69%)
Mutual labels:  domain-adaptation
CADA
Attending to Discriminative Certainty for Domain Adaptation
Stars: ✭ 17 (-94.44%)
Mutual labels:  domain-adaptation
KD3A
Here is the official implementation of the model KD3A in paper "KD3A: Unsupervised Multi-Source Decentralized Domain Adaptation via Knowledge Distillation".
Stars: ✭ 63 (-79.41%)
Mutual labels:  domain-adaptation
domain adapt
Domain adaptation networks for digit recognitioning
Stars: ✭ 14 (-95.42%)
Mutual labels:  domain-adaptation
cmd
Central Moment Discrepancy for Domain-Invariant Representation Learning (ICLR 2017, keras)
Stars: ✭ 53 (-82.68%)
Mutual labels:  domain-adaptation
lidar transfer
Code for Langer et al. "Domain Transfer for Semantic Segmentation of LiDAR Data using Deep Neural Networks", IROS, 2020.
Stars: ✭ 54 (-82.35%)
Mutual labels:  domain-adaptation
chainer-ADDA
Adversarial Discriminative Domain Adaptation in Chainer
Stars: ✭ 24 (-92.16%)
Mutual labels:  domain-adaptation
fusion gan
Codes for the paper 'Learning to Fuse Music Genres with Generative Adversarial Dual Learning' ICDM 17
Stars: ✭ 18 (-94.12%)
Mutual labels:  domain-adaptation
Salad
A toolbox for domain adaptation and semi-supervised learning. Contributions welcome.
Stars: ✭ 257 (-16.01%)
Mutual labels:  domain-adaptation
adapt
Awesome Domain Adaptation Python Toolbox
Stars: ✭ 46 (-84.97%)
Mutual labels:  domain-adaptation
autodial
AutoDIAL Caffe Implementation
Stars: ✭ 28 (-90.85%)
Mutual labels:  domain-adaptation

Real-Time Self-Adaptive Deep Stereo

Extended version just uploaded to arxive: Link. Code for the extended version will be released soon.

Code for Real-time self-adaptive deep stereo, accepted as ORAL at CVPR 2019.

| paper | video | CVPR_Live_Demo |

image

Abstract:

Deep convolutional neural networks trained end-to-end are the undisputed state-of-the-art methods to regress dense disparity maps directly from stereo pairs. However, such methods suffer from notable accuracy drops when exposed to scenarios significantly different from those seen in the training phase (e.g.real vs synthetic images, indoor vs outdoor, etc). As it is unlikely to be able to gather enough samples to achieve effective training/ tuning in any target domain, we propose to perform unsupervised and continuous online adaptation of a deep stereo network in order to preserve its accuracy independently of the sensed environment. However, such a strategy can be extremely demanding regarding computational resources and thus not enabling real-time performance. Therefore, we address this side effect by introducing a new lightweight, yet effective, deep stereo architecture Modularly ADaptive Network (MADNet) and by developing Modular ADaptation (MAD), an algorithm to train independently only sub-portions of our model. By deploying MADNet together with MAD we propose the first ever realtime self-adaptive deep stereo system.

If you use this code please cite:

@InProceedings{Tonioni_2019_CVPR,
    author = {Tonioni, Alessio and Tosi, Fabio and Poggi, Matteo and Mattoccia, Stefano and Di Stefano, Luigi},
    title = {Real-time self-adaptive deep stereo},
    booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
    month = {June},
    year = {2019}    
}

Requirements

This software has been tested with python3 and tensorflow 1.10. All required packages can be installed using pip and requirements.txt

pip3 install -r requirements.txt

Pretrained Weights for Network

Pretrained weights for both DispNet and MADNet available here.

Online Adaptation Step by step on Video Sequences

  1. Create a csv file for your video sequence similar to example_list.csv.

    Each row should contain absolute paths to the input data in the following order:

    "path_to_left_rgb,path_to_right_rgb,path_to_groundtruth"

    Ground truth data will only be used to compute the network performance not for the online adaptation.

  2. Download pretrained network from here.

  3. Perform different kinds of online adaptation with Stereo_Online_Adaptation.py, to list all available options use python3 Stereo_Online_Adaptation.py -h.

Example of online adaptation using MADNet and MAD:

LIST="path/to/the/list/of/frames/" #the one described at step (1)
OUTPUT="path/to/output/folder"
WEIGHTS="path/to/pretrained/network"
MODELNAME="MADNet"
BLOCKCONFIG="block_config/MadNet_full.json"

python3 Stereo_Online_Adaptation.py \
    -l ${LIST} \
    -o ${OUTPUT} \
    --weights ${WEIGHTS} \
    --modelName MADNet \
    --blockConfig ${BLOCKCONFIG} \
    --mode MAD \
    --sampleMode PROBABILITY \
    --logDispStep 1

Additional details on available parameters:

  • --modelName: choose which disparity inference model to use, currently supports either "DispNet" or "MADNet"
  • --mode: how to perform online adaptation: NONE (no online adaptation only inference), FULL (adaptation by full online backprop), MAD (adaptation by partial backprop using MAD)
  • --blockConfig: path to a json file that specify how to subdivide the network into independent blocks for adaptation using MAD, some example are provided inside the block_config folder. Each innermost array inside the json file should correspond to layers belonging to the same independent group.
  • --sampleMode: specify how to sample portions of the network to train when using MAD.
  • --weights: path to the initial weights for the network, e.g., referring to the weights linked above and assuming of having extracted the zip file in the same folder as the python script, to load MADNet trained on synthetic data use --weights MADNet/synthetic/weights.ckpt
  • --logDispStep: save the disparity predicted every this number of steps.

Live inference and adaptation demo

The Demo sub-folder contains python code to run stereo online inference and/or adaptation from a webcam stream. Before running the demo you should implement in Demo/grabber.py a class that extends ImageGrabber and is tagged with the @register_camera_to_factory() decorator. The class should handle connection and disconnection from your stereo camera as well as all the op necessary to read/decode and rectify stereo frames. The file grabber.py contains: a commented SmattCam class with an implementation for a custom stereo camera implemented on an FPGA and a ZEDMini class to connect to a ZED stereo camera.

Once you have implemented the code to connect to your camera you should be able to run the demo using the Demo/Live_Adaptation_Demo.py script. The script accepts a bunch of parameters from the command line to, all the options can be listed using

python Live_Detection_Demo.py -h

Once started the script spawn two threads, one to read frames from the camera the others to process them through a stereo CNN. To stop execution just press something followed by enter on the shell where Live_Detection_Demo.py is running.

Native Correlation layers

All the test in the paper were conducted using correlation layers implemented in pure tensorflow operations, however we provide also a native CUDA version of the same layer that might be usefull for deployment on memory constrained devices. To use the native correlation layer:

  1. cd Nets/Native
  2. make
  3. cd ..
  4. vim sharedLayers.py
  5. Comment line 6, uncomment line from 12 to 19
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].