Coder Social home page Coder Social logo

deepvo's Introduction

DeepVO

Implementation of a Recurrent CNN for monocular visual odometry from video.

Following S. Wang, R. Clark, H. Wen, and N. Trigoni.

Usage

If you don't already have the KITTI odometry benchmark data, you'll need to download it. A download script is available for your convenience.

python download_kitti_data.py /drive/with/space/kitti

If the download doesn't work anymore, go to the source. Manually download the color, calibration, and ground truth files. You will have to enter an email address, and will get a download link. Download the zipped file, and extract its contents. You should now have a 'dataset' folder, with 'poses' and 'sequences' folders within.

Next, convert the KITTI image frames into optical flow images using FlowNet. Make sure you've pulled submodules first, e.g.:

git submodule update --init

Use the download script in flownet2/models/ to download pre-trained Caffe networks. This may take a while. Once that's done, build and run a Caffe image using the provided Makefile, which automatically mounts this repository and mounts your kitti data into the 'data' folder. Just modify the Makefile DATA variable to point to wherever your 'dataset' folder is.

make caffe

From within the container, you should see the project directory. Run the following to generate .flo images for all of your KITTI sequences. WARNING: This will take a very long time, you might want to remove any KITTI sequences that you don't plan to use (i.e. the training code only uses sequences 00-10). Also consider running this from within a tmux session.

./generate_flows.sh

Once that finishes you will have a flows/ folder within your dataset folder, containing flow images for all of the KITTI sequences. This data, along with the poses/ ground-truth, will be used for training and testing our LSTM network.

If you want to visualize these .flo images, use the flow-code library.

cd flow-code/imageLib/
make
cd ..
make

Now we're ready to train our network. As before, use the makefile to build and run a Keras docker container. Make sure you've exited the Caffe container first.

make keras

From within the container, train the model using:

python train_model.py

To visualize the loss function while training, use TensorBoard. Run the following in a separate terminal from the project root:

./start_tensorboard.sh

If you're on a server you'll have to forward the port, e.g. with

ssh -N -L 6006:localhost:6006 you@server

Now you should be able to track training by opening localhost:6006 in a browser.

Model weights are saved in 'snapshots'. The default weights file is written to "snapshots/model.h5". Move this if you restart training and want to start from scratch.

To test the trained model, use the test mode:

python src/train_model.py --mode test

which will output csvs to "test_results". To view the results graphically, install evo. The evo package has been installed for your convenience in the keras docker image.

Once you have evo installed, run

test_results/generate_plots.sh

to generate pdfs of the results.

deepvo's People

Contributors

bbritain1 avatar joecomerisnotavailable avatar noahrjohnson avatar

Watchers

 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.