This repository is an implementation of the following architectures:
- DeepVO: Towards end-to-end visual odometry with deep Recurrent Convolutional Neural Networks
- MagicVO: An End-to-End Hybrid CNN and Bi-LSTM Method for Monocular Visual Odometry
The code uses the FlowNetS pre-trained model FlowNet: Learning Optical Flow with Convolutional Networks.
Inside the main.py file is the asdas variable that serves as the configuration for the training.
modecode execution mode, such as totrainor topredict.datapathpath where the dataset is stored.bsizesize of batch size.lrlearning rate value for SGD and Adagrad optimizer.momentummomentum value for SGD optimizer.train_iternumber of epoch for training.checkpoint_pathpath where the checkpoint are stored.kdefault value for loss function.trainmodelDeepVOorMagicVOto be trained or predicted.
To download the weights of the models, download and place them in the checkpoints folder, where the download instructions are located.
For training, the KITTI Visual Odometry dataset has been used, you can change the training sequences in the file utils/dataset.py. For example, the following variable self.sequences = ['00', '02', '08', '09'] has been used for sequences 00, 02, 08 and 09, which are the most extensive.
The structure containing the dataset must agree to the following:
<path where the dataset has been stored>\dataset
-->\poses
--> \00.txt
--> \01.txt
...
-->\sequences
--> \00
--> \01
...
- Run the
main.pyfile with changes to theconfigvariable for DeepVO model training
config = { 'mode': 'train', 'datapath': 'D:\EduardoTayupanta\Documents\Librerias\dataset', 'bsize': 8, 'lr': 0.001, 'momentum': 0.99, 'train_iter': 20, 'checkpoint_path': './checkpoints', 'k': 100, 'train': 'deepvo' }
- Run the
main.pyfile with changes to theconfigvariable for MagicVO model training
config = { 'mode': 'train', 'datapath': 'D:\EduardoTayupanta\Documents\Librerias\dataset', 'bsize': 8, 'lr': 0.001, 'momentum': 0.99, 'train_iter': 20, 'checkpoint_path': './checkpoints', 'k': 100, 'train': 'magicvo' }