• Stars
    star
    167
  • Rank 226,635 (Top 5 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created over 2 years ago
  • Updated over 1 year ago

Reviews

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

Repository Details

[ICRA'23] DytanVO: Visual Odometry in Dynamic Environments

DytanVO: Joint Refinement of Visual Odometry and Motion Segmentation in Dynamic Environments

DytanVO: Joint Refinement of Visual Odometry and Motion Segmentation in Dynamic Environments (ICRA 2023)
By Shihao Shen, Yilin Cai, Wenshan Wang, and Sebastian Scherer.

What's new.

  • 01-17-2023: Our paper has been accepted to ICRA 2023!

  • 01-05-2023: Clean up and upload the codebase for DytanVO. Pretrained weights and datasets are also ready.

  • 09-20-2022: Remove Dynamic Dense RGB-D SLAM with Learning-Based Visual Odometry. The repo will be used to release codebase for the most recent ICRA 2023 submission.

Introduction

DytanVO is a learning-based visual odometry (VO) based on its precursor, TartanVO. It is the first supervised learning-based VO method that deals with dynamic environments. It takes two consecutive monocular frames in real-time and predicts camera ego-motion in an iterative fashion. It achieves an average improvement of 27.7% over state-of-the-art VO solutions in real-world dynamic environments, and even performs competitively among dynamic visual SLAM systems which optimize the trajectory on the backend. Experiments on plentiful unseen environments also demonstrate its generalizability.

Installation

We provide an environment file using anaconda. The code has been tested on an RTX 2080Ti with CUDA 11.4.

conda env create -f environment.yml
conda activate dytanvo

Compile DCNv2.

cd Network/rigidmask/networks/DCNv2/; python setup.py install; cd -

Models and Data

Pretrained weights

Download here and unzip it to the models folder.

KITTI dynamic sequences

Original sequences in KITTI Odometry are trimmed into sub-sequences which contain moving pedestrians, vehicles and cyclists so that VO's robustness to dynamic objects can be explicitly evaluated. Download DynaKITTI and unzip it to the data folder. Please cite this paper if you find it useful in your work.

AirDOS-Shibuya

Follow tartanair-shibuya and download it to the data folder.

(Optional) Scene Flow

One can also test the model on Scene Flow datasets, which was used to train both the VO and the segmentation networks. Scene Flow datasets have very challenging sequences with large areas of dynamic objects in image frames.

You can create symbolic links to wherever the datasets were downloaded in the data folder.

β”œβ”€β”€ data
    β”œβ”€β”€ AirDOS_shibuya
        β”œβ”€β”€ RoadCrossing03
            β”œβ”€β”€ image_0
            β”œβ”€β”€ ...
            β”œβ”€β”€ gt_pose.txt
        β”œβ”€β”€ RoadCrossing04
        β”œβ”€β”€ ...
    β”œβ”€β”€ DynaKITTI
        β”œβ”€β”€ 00_1
            β”œβ”€β”€ image_2
            β”œβ”€β”€ ...
            β”œβ”€β”€ pose_left.txt
            β”œβ”€β”€ calib.txt
        β”œβ”€β”€ 01_0
        β”œβ”€β”€ ...
    β”œβ”€β”€ SceneFlow
        β”œβ”€β”€ FlyThings3D
            β”œβ”€β”€ frames_cleanpass
            β”œβ”€β”€ frames_finalpass
            β”œβ”€β”€ optical_flow
            β”œβ”€β”€ camera_data
        β”œβ”€β”€ Driving
        β”œβ”€β”€ Monkaa
    β”œβ”€β”€ ...

Evaluation

Create a folder to save output flow, segmentation, or poses.

mkdir results

Dynamic sequences in KITTI (loading the finetuned VO model at once)

traj=00_1
python -W ignore::UserWarning vo_trajectory_from_folder.py --vo-model-name vonet_ft.pkl  \
							   --seg-model-name segnet-kitti.pth  \
							   --kitti --kitti-intrinsics-file data/DynaKITTI/$traj/calib.txt  \
							   --test-dir data/DynaKITTI/$traj/image_2  \
							   --pose-file data/DynaKITTI/$traj/pose_left.txt 

AirDOS-Shibuya (loading FlowNet and PoseNet separately)

traj=RoadCrossing03
python -W ignore::UserWarning vo_trajectory_from_folder.py --flow-model-name flownet.pkl  \
							   --pose-model-name posenet.pkl  \
							   --seg-model segnet-sf.pth  \
							   --airdos  \
							   --test-dir data/AirDOS_shibuya/$traj/image_0  \
							   --pose-file data/AirDOS_shibuya/$traj/gt_pose.txt 

Scene Flow

img=Driving/frames_finalpass/15mm_focallength/scene_forwards/fast/left
pose=Driving/camera_data/15mm_focallength/scene_forwards/fast/camera_data.txt
python -W ignore::UserWarning vo_trajectory_from_folder.py --flow-model-name flownet.pkl  \
							   --pose-model-name posenet.pkl  \
							   --seg-model segnet-sf.pth  \
							   --sceneflow  \
							   --test-dir data/SceneFlow/$img  \
							   --pose-file data/SceneFlow/$pose

Add --save-flow tag to save intermediate optical flow outputs into the results folder.

Adjust the batch size and the worker number by --batch-size 10, --worker-num 5.

(Optional) Segmentation Mask Ground Truth

If your dataset has ground truth for camera motion, optical flow and disparity change across consecutive frames, we provide an example script to automatically generate ground truth of segmentation mask given these two modalities based on the pure geometry for the Scene Flow datasets.

python Datasets/segmask_gt.py --database data/SceneFlow --frames_pass clean --dataset FlyingThings3D

Add --debug flag to save visualizations of the generated masks.

Citation

If you find our code, paper or dataset useful, please cite

@inproceedings{shen2023dytanvo,
  title={Dytanvo: Joint refinement of visual odometry and motion segmentation in dynamic environments},
  author={Shen, Shihao and Cai, Yilin and Wang, Wenshan and Scherer, Sebastian},
  booktitle={2023 IEEE International Conference on Robotics and Automation (ICRA)},
  pages={4048--4055},
  year={2023},
  organization={IEEE}
}

Acknowledgement

We built DytanVO on top of TartanVO. We implemented the segmentation network by adapting rigidmask. We thank Gengshan Yang for his code and suggestions.

License

This software is BSD licensed.

Copyright (c) 2020, Carnegie Mellon University All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

More Repositories

1

tartanair_tools

TartanAir dataset tools and samples
Jupyter Notebook
294
star
2

tartancalib

TartanCalib: Iterative Wide-Angle Lens Calibration using Adaptive SubPixel Refinement of AprilTags
C++
233
star
3

tartanvo

TartanVO: A Generalizable Learning-based VO
Python
225
star
4

tartan_drive

Tartan Drive dataset tools and utilities.
Python
53
star
5

xplane_ros

A ROS wrapper for the XPlane-11 flight simulator.
Python
33
star
6

PX4-fully-actuated

PX4 autopilot extended to fully-actuated multirotors
C++
25
star
7

tartan_drive_2.0

Python
23
star
8

lidar_eskf

C++
22
star
9

mcts-stl-planning

Online Signal Temporal Logic (STL) Monte-Carlo Tree Search for Guided Imitation Learning
Python
22
star
10

cvar-energy-risk-deep-model

CVaR-based Flight Energy Risk Assessment for Multirotor UAVs using a Deep Energy Model
Python
19
star
11

learned_cost_map

Python
14
star
12

alfa-dataset-tools

Tools for working with ALFA datset
C++
14
star
13

trochoids

Time-optimal path planning for UAVs in wind using trochoids and Dubins set classification. Package also includes a fast Dubins path solver in no-wind scenarios.
C++
14
star
14

trajairnet

A socially-aware trajectory prediction algorithm
Python
13
star
15

tigris

TIGRIS: An Informed Sampling-based Informative Path Planner
13
star
16

wind_estimator

C++
7
star
17

tartanairpy

A Python package for the TartanAir-V2 dataset.
Python
7
star
18

WIT-UAS-Dataset

Object Detection for High-altitude Infrared Thermal Dataset
Jupyter Notebook
6
star
19

castacks.github.io

AirLab's website source
TeX
6
star
20

semantic_3d_mapping

C++
6
star
21

inspection_sim

C++
4
star
22

maxent_irl_maps

Python
4
star
23

alfa-dataset

3
star
24

trajectory_control

C++
2
star
25

dsta_docker

Dockerfiles and scripts for the DSTA project.
Shell
2
star
26

octomap_tools

C++
2
star
27

firevision_sim

A Visually Stunning Fire IR Simulator for SLAM and Perception
Python
2
star
28

matlab_planning_toolbox

MATLAB
1
star
29

wildfire-m600-firefly

C++
1
star
30

sony_cam_calib_exe

Sony instance search project. A folder holds the script for funning the camera calibration.
Shell
1
star
31

MultiDroneMultiActorFilming

Julia
1
star
32

sony_cam_calib

ROS workspace for camera calibration used for the Sony instance search project.
1
star
33

sony_docker

Docker scripts and dockerfiles for the Sony instance search project.
Dockerfile
1
star
34

dsta_vpi_resample_fisheye

Resample fisheye image using VPI. DSTA project.
C++
1
star
35

airlab_ros_common

Common definitions for ROS used in airlab research projects.
CMake
1
star
36

shimizu_sys_utils

Some system utilities for the Shimizu project.
CMake
1
star
37

mvs_gi_download

Download scripts of the dataset from mvs_gi project.
Python
1
star
38

MetaSLAM

A general Meta SLAM framework
1
star
39

image_sampler

Image sampler for synthetic data generation.
Python
1
star
40

mvs_utils

Utility codes for multi-view stereo.
Python
1
star
41

TartanDrive2

Website for tartan_drive_2.0 repo
JavaScript
1
star