Giter Club home page Giter Club logo

sfm-learner-chainer's Introduction

SfMLearner Chainer version

This codebase implements the system described in the paper:

Unsupervised Learning of Depth and Ego-Motion from Video link
See the project webpage for more details.

TF code: https://github.com/tinghuiz/SfMLearner

Preparing training data

In order to train the model using the provided code, the data needs to be formatted in a certain manner.

Depth

For KiTTI, first download the dataset using this script provided on the official website, and then run the following command

python data/prepare_train_data.py /path/to/KITTI_raw --dataset-format kitti_raw --static-frames ./data/static_frames.txt  --dump-root /path/to/KITTI_formatted --height 128 --width 416 --num-threads 8

Odometry

This script generates only training data.
Remove '2011_09_26_drive_0067' sequence because there is no data at kitti server.

python data/prepare_train_data.py /path/to/KITTI_raw --dataset-format kitti_odom --static-frames ./data/static_frames.txt  --dump-root /path/to/KITTI_formatted --height 128 --width 416 --num-threads 8

Training using KiTTI Raw Dataset

Once the data are formatted following the above instructions, you should be able to train the model by running the following command

Depth

python3 train.py experiments/sfm_learner_v1.yml

Odometry

python3 train.py experiments/sfm_learner_v1_odom.yml

Evaluation using KiTTI Raw Dataset

If you finish training models using above scripts, you should be able to evaluate your trained model.

Depth

You can obtain the single-view depth predictions on the KITTI eigen test split formatted properly for evaluation by running.
You could download pretrained model from here

python evaluate.py experiments/sfm_learner_v1_eval.yml

Odometry

You can obtain the 5-snipped odometry predictions on the KITTI odometry dataset. This scripts use kitti raw dataset directly.

python evaluate.py experiments/sfm_learner_v1_odom_eval.yml --mode odom
abs_rel sq_rel rms log_rms a1 a2 a3
0.1779 1.3594 6.2696 0.2570 0.7390 0.9075 0.9647

Inference using KiTTI Raw Dataset

Depth

You could download pretrained model from here

# For kitti formatted dataset
python inference.py experiments/sfm_learner_v1_test.yml
# For a image
python inference.py experiments/sfm_learner_v1_test.yml --img_path /path/to/img --save 1 --width 416 --height 128

odometry

# Create predicted trajectory
python inference.py experiments/sfm_learner_v1_odom_test.yml --mode odom
# Visualize trajectories
python inference.py experiments/sfm_learner_v1_odom_test.yml --mode odom --gt_file ./kitti_eval/pose_data/ground_truth/10_full.txt --pred_file ./test.txt

sfm-learner-chainer's People

Contributors

yukitsuji avatar takerum avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.