Git Product home page Git Product 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

noahrjohnson avatar joecomerisnotavailable avatar bbritain1 avatar

Stargazers

Renato Martins avatar  avatar William Emfinger avatar  avatar Lingxiang Zheng avatar 123 avatar shumingcong avatar  avatar  avatar

Watchers

James Cloos avatar  avatar  avatar  avatar

deepvo's Issues

Replicating the results.

Hi,

Were you able to replicate the results of the paper? Can you maybe publish the results as well?

Thank you

compilation error: fatal error: numpy/arrayobject.h: No such file or directory

Hi,

In order to build and run a Caffe image using the provided Makefile ($ make caffe), I face with the following error:

make: Nothing to be done for 'tools'.
python/caffe/_caffe.cpp:10:31: fatal error: numpy/arrayobject.h: No such file or directory
compilation terminated.
make: *** [python/caffe/_caffe.so] Error 1
Makefile:502: recipe for target 'python/caffe/_caffe.so' failed
The command '/bin/sh -c make -j"$(nproc)" all tools pycaffe' returned a non-zero code: 2
Makefile:18: recipe for target 'build-caffe' failed
make: *** [build-caffe] Error 2

the output of ($ sudo find / -name arrayobject.h) in my ubuntu 16.04 is:

/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h
/usr/lib/python3/dist-packages/numpy/core/include/numpy/arrayobject.h
/var/lib/docker/overlay2/b63fc56cdd3bd4684f1f83821f6bbae2fdfc75891df50c06a357eb71661e4ca2/diff/usr/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h
/var/lib/docker/overlay2/27b0d55a46e6c38db226b8e3b7a7dc12d4b7fb61d1722877c0cd11b6035185df/diff/usr/local/lib/python2.7/dist-packages/numpy/core/include/numpy/arrayobject.h
/home/xenial/.local/lib/python3.5/site-packages/numpy/core/include/numpy/arrayobject.h
/home/xenial/.local/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h
/home/xenial/anaconda2/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h
/home/xenial/anaconda2/pkgs/numpy-base-1.16.4-py27hde5b4d6_0/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h
/home/xenial/anaconda2/envs/d2l/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h
find: ‘/run/user/1000/gvfs’: Permission denied

screenshot of terminal in case it is useful:

python

Is there anything I am doing wrong in assigning the python2.7 path on my system?
Cheers,

Epoch should cache data when loading a batch

If step_size is less than the sliding window size, right now Epoch will redundantly load the same flow images and poses for every sample. It would be more efficient to calculate the total range of data first, load all of it once, and split it up into samples.

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.