Skip to content
forked from NVlabs/geomapnet

Geomapnet under challenging conditions

License

Notifications You must be signed in to change notification settings

a1302z/geomapnet

 
 

Repository files navigation

Mapnet under challenging conditions

We evaluated NVIDIA's mapnet model under challenging conditions using the AachenDayNight dataset. We use the percentage formulation that is also used here.

Furthermore, we tested the influence of two augmentation techniques:

  1. We augmented the dataset by artificial night images generated by a CycleGAN network.
  2. We forced the model to also learn a semantic segmentation of the input images as additional targets. The semantic segmentation was generated using this repository.
Concept of multitask
Concept of multitask model
Artificial night images Semantic targets Day-time results Night-time results
no no 0 / 0 / 8.4 0 / 0 / 0
yes no 0 / 0.1 / 16.1 0 / 0 / 4.1
no yes 0 / 0.1 / 17.4 0 / 0 / 5.1
yes yes 0 / 0 / 21.6 0 / 0 / 9.1
Modifications to NVIDIA repository

Modifications by Leonhard Feiner and Alexander Ziller:

  • Support for DeepLoc dataset
  • Development of Dual-Input model (additional semantics as input to model)
  • Development of Multitask model (additional semantics as output to model)

Modifications by Alexander Ziller:

  • Support for AachenDayNight and Cambridge Landmarks dataset
  • Including augmentations for AachenDayNight dataset (using CycleGANs)

Data

Currently supported datasets
Additional data for Aachen Day Night

Getting Started

Setup

Unlike the original implementation we use Python 3.

MapNet uses a Conda environment that makes it easy to install all dependencies.

  1. Install Anaconda
  2. Create the mapnet Conda environment: conda env create -f environment_py3.yml.
  3. Activate the environment: conda activate mapnet_release.
To use a dataset
  1. Create in data/deepslam_data a directory with the corresponding name e.g. AachenDayNight
  2. Download data into this directory
  3. Go to scripts directory and run dataset_mean.py and calc_pose_stats.py (also good to verify data structure is correct)

Running the code

Available models

The following models are available

  • Posenet: Standard visuallocalization network by Alex Kendall
  • Mapnet: Base where this repository is forked from
  • Mapnet++: Mapnet with additional visual odometry and GPS data
  • Multitask: Mapnet with additional semantics as output (learning target)
Training

The executable script is scripts/train.py. See python train.py -h for options.

Example usage:

python train.py --dataset AachenDayNight --model mapnet --config configs/mapnet.ini --learn_beta --learn_gamma

If you have visdom = yes in the config file, you will need to start a Visdom server for logging the training progress:

python -m visdom.server -env_path=scripts/logs/.

Demo/Inference

The inference script is scripts/eval.py. See python eval.py -h for options. Please store downloaded models in scripts/logs.and go to the scripts folder to run the commands.

Mapnet model weights trained on the Aachen Day Night dataset can be downloaded here

Visual Explanations of Model

We included code to calculate maps as described in the GradCam++ paper.

Example usage:

python show_gradcampp.py --dataset DeepLoc --model multitask --val --n_activation_maps 3 --layer_name layer1,layer2 --config_file configs/uncertainty-criterion.ini --weights logs/DeepLoc__multitask_multitask-new-criterion_learn_beta_learn_gamma_learn_sigma_seed13/epoch_300.pth.tar

Credits

This repository is a fork of NVIDIA's mapnet repository. Look there for more background and additional information.

Leonhard Feiner contributed equally to include support for learning semantic labels until commit 7e5c754.

License

Copyright (C) 2018 NVIDIA Corporation. All rights reserved. Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).

Documentation

The original CVPR 2018 paper can be found at

Samarth Brahmbhatt, Jinwei Gu, Kihwan Kim, James Hays, and Jan Kautz. Geometry-Aware Learning of Maps for Camera Localization. CVPR 2018..

My master's thesis that discusses those results can be found here

Citation

Citation for original MapNet:

@inproceedings{mapnet2018,
  title={Geometry-Aware Learning of Maps for Camera Localization},
  author={Samarth Brahmbhatt and Jinwei Gu and Kihwan Kim and James Hays and Jan Kautz},
  booktitle={IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
  year={2018}
}

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.3%
  • Shell 0.7%