• Stars
    star
    146
  • Rank 252,769 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 5 years ago

Reviews

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

Repository Details

Inference pipeline for the CVPR paper entitled "Real-Time Monocular Depth Estimation using Synthetic Data with Domain Adaptation via Image Style Transfer" (http://atapour.co.uk/papers/atapour18monocular.pdf).

Real-Time Monocular Depth Estimation using Synthetic Data with Domain Adaptation via Image Style Transfer

Requires an NVIDIA GPU, Python 2 or 3, CUDA CuDNN, PyTorch 0.3.1 or PyTorch 0.4.0, and OpenCV,

General Pipeline                                                                                     General pipeline of the approach

Method:

"Monocular depth estimation using learning-based approaches has become relevant and promising in recent years. However, most monocular depth estimators either need to rely on large quantities of ground truth depth data, which is extremely expensive and difficult to obtain or predict disparity as an intermediary step using a secondary supervisory signal, leading to blurring and other artefacts. Training a depth estimation model using pixel-perfect synthetic environment data can resolve most of these issues, but introduces the problem of domain bias. This is the inability to apply a model trained on synthetic data to real-world scenarios. With recent advances in image style transfer and its connections with domain adaptation (Maximum Mean Discrepancy), our approach takes advantage of style transfer and adversarial training to predict pixel perfect depth from a single real-world color image based on training over a large corpus of synthetic environment data. Experimental results indicate the efficacy of our approach compared to contemporary state-of-the-art."

[Atapour-Abarghouei and Breckon, Proc. CVPR, 2018]


Reference implementation:

Produces a depth map output image based on a monocular color image input.

  • The input RGB image will first be transformed into the style of the images captured from a highly realistic synthetic virtual environment, on which the depth prediction network is trained.
  • The provided color image is used as the input to CycleGAN, which transforms the style of the image. Image style transfer is used as a method of domain adaptation.
  • The style transferred image is used as the input to a model trained on synthetic images and can produce pixel-perfect depth outputs.
  • The code provides an inference pipeline and can be run using the test harness: run_test.py
  • Example images are provided in the 'Examples' directory.
  • The training was in part performed based on the code from https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix, and we would like to thank the authors and contributors.

                                                                          Example of the results of the approach


Instructions to run the inference code using PyTorch 0.3.1:

$ git clone https://github.com/atapour/monocularDepth-Inference.git
$ cd monocularDepth-Inference
$ chmod +x ./download_pretrained_models.sh
$ ./download_pretrained_models.sh
$ python run_test.py --data_directory=./Examples --checkpoints_dir=./checkpoints --results_dir=./results

Instructions to run the inference code using PyTorch 0.4.0:

$ git clone https://github.com/atapour/monocularDepth-Inference.git
$ cd monocularDepth-Inference
$ chmod +x ./download_pretrained_models.sh
$ ./download_pretrained_models.sh
$ python remove_running_stats.py
$ python run_test.py --data_directory=./Examples --checkpoints_dir=./checkpoints --results_dir=./results

The output results are written in a directory taken as an argument to the test harness ('./results' by default):

  • the script entitled "download_pretrained_models.sh" will download the required pre-trained models and checks the downloaded file integrity using MD5 checksum.
  • the checkpoints that are available for direct download were created using pyTorch 0.3.1 and will not work if you are using pyTorch 0.4.0. The provided python script named ' remove_running_stats.py' will remedy the situation.
  • the file with the suffix "_original" is the original input image.
  • the file with the suffix "_restyled" is the style transferred image.
  • the file with the suffix "_depth" is the output depth image.

Example:

Video Example

                                                                          Video Example - click image above to play.


Reference:

Real-Time Monocular Depth Estimation using Synthetic Data with Domain Adaptation via Image Style Transfer (A. Atapour-Abarghouei, T.P. Breckon), In Proc. Conf. Computer Vision and Pattern Recognition, 2018. [pdf] [demo]

@InProceedings{abarghouei18monocular,
  author = 		{Atapour-Abarghouei, A. and Breckon, T.P.},
  title = 		{Real-Time Monocular Depth Estimation using Synthetic Data with Domain Adaptation},
  booktitle = 	{Proc. Computer Vision and Pattern Recognition},
  pages =		{1-8},
  year = 		{2018},
  month = 		{June},
  publisher = 	{IEEE},
  keywords = 		{monocular depth, generative adversarial network, GAN, depth map, disparity, depth from single image},
}


More Repositories

1

depthComp

A real-time depth filling approach based on prior image segmentation (http://www.atapour.co.uk/papers/BMVC2017.pdf).
C++
38
star
2

ip-python-opencv

Examples and code demonstrations for the Image Processing module at Durham University
Python
34
star
3

temporal-depth-segmentation

Source code (train/test) accompanying the paper entitled "Veritatem Dies Aperit - Temporally Consistent Depth Prediction Enabled by a Multi-Task Geometric and Semantic Scene Understanding Approach" in CVPR 2019 (https://arxiv.org/abs/1903.10764).
Python
19
star
4

rank-over-class

Source code for the training pipeline of the text ranking model used in the paper entitled "Rank over Class: The Untapped Potential of Ranking in Natural Language Processing" (https://arxiv.org/abs/2009.05160).
Python
10
star
5

ransomware-classification

Training and testing pipeline for ransomware classification based on screenshots of the splash screens or ransom notes (https://arxiv.org/pdf/1908.06750.pdf).
Python
9
star
6

dl-pytorch

Examples and code demonstrations for the Deep Learning module at Durham University
Jupyter Notebook
8
star
7

depth-hole-prediction

This repository contains code for training and testing a model used to predict where holes would appear in a depth image based on an RGB image input.
Python
7
star
8

keras-dl-examples

Examples and demonstration written in Python and Keras used in the "Deep Learning" lecture series at Newcastle University (CSC8637).
Jupyter Notebook
3
star
9

invisible-me

This repo contains a set of simple excercises in colour filtering from a live video image. The demo will lead to the implementation of a simple "cloak of invisibility".
Python
2
star
10

PyTorch_Demo

Simple PyTorch code demonstration.
Jupyter Notebook
1
star