• Stars
    star
    196
  • Rank 198,553 (Top 4 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 3 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Lightweight stereo matching network based on MobileNet blocks

MobileStereoNet

Python 3.6

This repository contains the code for "MobileStereoNet: Towards Lightweight Deep Networks for Stereo Matching", presented at WACV 2022 [Paper] [Supp] [arXiv] [Video Presentation].

drawing

Input image

drawing drawing

2D-MobileStereoNet prediction

drawing drawing

3D-MobileStereoNet prediction

Evaluation Results

MobileStereoNets are trained and tested using SceneFlow (SF), KITTI and DrivingStereo (DS) datasets.
In the following tables, the first columns show the training sets. For instance, in the case of "SF + KITTI2015", the model is firstly pretrained on the SceneFlow dataset, and then finetuned on KITTI images.
The results are reported in End-point Error (EPE); the lower, the better.
Note that some experiments evaluate the zero-shot cross-dataset generalizability, e.g. when the model is trained on "SF + DS" and evaluated on "KITTI2015 val" or "KITTI2012 train".
The related trained models are provided in the tables as hyperlinks.

  • 2D-MobileStereoNet
SF test DS test KITTI2015 val KITTI2012 train
SF 1.14 6.59 2.42 2.45
DS - 0.67 1.02 0.96
SF + DS - 0.73 1.04 1.04
SF + KITTI2015 - 1.41 0.79 1.18
DS + KITTI2015 - 0.79 0.65 0.91
SF + DS + KITTI2015 - 0.83 0.68 0.90
  • 3D-MobileStereoNet
SF test DS test KITTI2015 val KITTI2012 train
SF 0.80 4.50 10.30 9.38
DS - 0.60 1.16 1.14
SF + DS - 0.57 1.12 1.10
SF + KITTI2015 - 1.53 0.65 0.90
DS + KITTI2015 - 0.65 0.60 0.85
SF + DS + KITTI2015 - 0.62 0.59 0.83

Results on KITTI 2015 validation

Predictions of difference networks

Results on KITTI 2015 Leaderboard

Leaderboard
2D-MobileStereoNet on the leaderboard
3D-MobileStereoNet on the leaderboard

Computational Complexity

Requirements for computing the complexity by two methods:

pip install --upgrade git+https://github.com/sovrasov/flops-counter.pytorch.git
pip install --upgrade git+https://github.com/Lyken17/pytorch-OpCounter.git
pip install onnx

Run the following command to see the complexity in terms of number of operations and parameters.

python cost.py

You can also compute the complexity of each part of the network separately. For this, the input size of each module has been written in cost.py.

Installation

Requirements

The code is tested on:

  • Ubuntu 18.04
  • Python 3.6
  • PyTorch 1.4.0
  • Torchvision 0.5.0
  • CUDA 10.0

Setting up the environment

conda env create --file mobilestereonet.yml
conda activate mobilestereonet

SceneFlow Dataset Preparation

Download the finalpass images and the disparity data for SceneFlow FlyingThings3D, Driving and Monkaa. For both, image and disparity data, move the directories in the TRAIN and TEST directories of the Driving and Monkaa Dataset (15mm_focallength/35mm_focallength for Driving, funnyworld_x2 etc. for Monkaa) into the FlyingThings3D TRAIN and TEST directories, respectively.

It should look like this:

frames_finalpass
β”‚
└───TEST
β”‚   β”‚
β”‚   └───A
β”‚   └───B
β”‚   └───C
β”‚   
β”‚
└───TRAIN
β”‚   β”‚
β”‚   └───15mm_focallength
β”‚   └───35mm_focallength
β”‚   └───A
β”‚   └───a_rain_of_stones_x2
β”‚   └─── ..

Training

Set a variable for the dataset directory, e.g. DATAPATH="/Datasets/SceneFlow/". Then, run train.py as below:

Pretraining on SceneFlow

python train.py --dataset sceneflow --datapath $DATAPATH --trainlist ./filenames/sceneflow_train.txt --testlist ./filenames/sceneflow_test.txt --epochs 20 --lrepochs "10,12,14,16:2" --batch_size 8 --test_batch_size 8 --model MSNet2D

Finetuning on KITTI

python train.py --dataset kitti --datapath $DATAPATH --trainlist ./filenames/kitti15_train.txt --testlist ./filenames/kitti15_val.txt --epochs 400 --lrepochs "200:10" --batch_size 8 --test_batch_size 8 --loadckpt ./checkpoints/pretrained.ckpt --model MSNet2D

The arguments in both cases can be set differently depending on the model, dataset and hardware resources.

Prediction

The following script creates disparity maps for a specified model:

python prediction.py --datapath $DATAPATH --testlist ./filenames/kitti15_test.txt --loadckpt ./checkpoints/finetuned.ckpt --dataset kitti --colored True --model MSNet2D

Credits

The implementation of this code is based on PSMNet and GwcNet. Also, we would like to thank the authors of THOP: PyTorch-OpCounter, Flops counter and KITTI python utils.

License

This project is released under the Apache 2.0 license.

Citation

If you use this code, please cite this paper:

@inproceedings{shamsafar2022mobilestereonet,
  title={MobileStereoNet: Towards Lightweight Deep Networks for Stereo Matching},
  author={Shamsafar, Faranak and Woerz, Samuel and Rahim, Rafia and Zell, Andreas},
  booktitle={Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision},
  pages={2417--2426},
  year={2022}
}

Contact

The repository is maintained by Faranak Shamsafar.
[email protected]

More Repositories

1

gerona

GeRoNa (Generic Robot Navigation) is a modular robot navigation framework, that bundles path planning and path following (including obstacle detection) and manages communication between the individual modules. It is designed to be easily extensible for new tasks and robot models.
C++
310
star
2

CBMOT

This repo contains the official code for the paper 'Score refinement for confidence-based 3D multi-object tracking'
Python
58
star
3

cslibs_ndt

This library contains fast and sparse implementations of multi-dimensional map representations using Normal Distributions Transforms.
C++
48
star
4

FourierNet

Python
45
star
5

cslibs_mapping

This library contains a plugin-based mapping framework which allows to build 2D gridmaps, 2D and 3D NDT maps and OctoMaps.
C++
42
star
6

csapex

Rapid prototyping and experimentation framework for robotics and cognitive systems based synchronous data flow and visual programming.
C++
25
star
7

deephs_fruit

Measuring the ripeness of fruit with Hyperspectral Imaging and Deep Learning
Python
24
star
8

uninas

A highly modular PyTorch framework with a focus on Neural Architecture Search (NAS).
Python
21
star
9

PAL

Reference implementation of the PAL optimizer
Python
20
star
10

prdarts

Code for our paper "Prune and Replace NAS"
Python
17
star
11

csapex_generic_obstacle_detection

Published in the proceedings of IROS 2016 with the title "Generic 3D Obstacle Detection for AGVs Using Time-of-Flight Cameras".
C++
15
star
12

cslibs_path_planning

C++
9
star
13

event_simulator_ros

Real-time event simulation with frame-based cameras (ROS wrapper)
C++
8
star
14

tristereonet

Python
8
star
15

hyve_conv

Python
5
star
16

jaco2_ros

Alternative ROS package for the Kinova Jaco2
C++
5
star
17

spindoe

Dot-pattern-based spin estimation method for table tennis balls
Python
5
star
18

cslibs_image_align

This library contains an AVX optimized implementation of the efficient second order minimization and inverse compositional image alignment methods, including two methods for outlier rejection.
C++
4
star
19

muse_armcl

ARMCL: ARM Contact point Localization via Monte Carlo Localization
C++
3
star
20

cslibs_kdl

Kinematic and Dynamic Library for Manipulators wraps Orocos KDL and trac_ik solvers. Provides an external torque observer.
C++
3
star
21

cp_eval

Python
2
star
22

crow_tiling

Python
2
star
23

separable-3D-convs-for-stereo-matching

Python
2
star
24

muse_mcl_2d

C++
2
star
25

csapex_core_plugins

This project contains basic plugins for the Algorithm Prototyper and EXperimentor (cs::APEX.)
C++
2
star
26

ai_competition

Repository for the diana chess competition. AI Lecture 21/22
Python
2
star
27

event_simulator

Real-time event simulation with frame-based cameras
C++
2
star
28

csapex_person_detection_pcl

This project contains plugins for the Algorithm Prototyper and EXperimentor (cs::APEX) which implement the PCL 3D person detection functionality. https://www.ra.cs.uni-tuebingen.de/software/apex/
C++
2
star
29

cslibs_indexed_storage

C++
1
star
30

Distilling-Stereo-Networks

1
star
31

muse_smc

C++
1
star
32

hsi_benchmark

DeepHS Benchmark: Bridging the Gap between HSI Applications through Comprehensive Dataset and Pretraining
Python
1
star