- For simpler experience, the code assumes KITTI odom. datasets only at the moment.
- Docker based environment is considered to be main branch for consistent experience.
- The ground truth and psuedo-imu data is added.
- The actual image data need to be put in the folder.
- Weihts zip file is linked.
- Lots of codes need to be organized and refactored further.
- For training, still reuquires big RAM capacity to read the data.
Deep learning based visual-inertial odometry project.
pros:
- Lighter CNN structure. No RNNs -> much lighter.
- Training images together with inertial data using exponential mapping.
- Rotation is coming from external attitude estimation.
- No RNN but Kalman filter: Accleration and image fusion for frame-to-frame displacement.
cons:
- no position correction: drift in position: But SLAM can correct the position drfit.
Hongyun Lee, James W. Gregory, Matthew McCrink, and Alper Yilmaz. "Deep Learning for Visual-Inertial Odometry: Estimation of Monocular Camera Ego-Motion and its Uncertainty" The Ohio State University, Master Thesis, http://rave.ohiolink.edu/etdc/view?acc_num=osu156331321922759
-
OS
- Ubuntu 22.04
- VSCode
-
Hardware
- CPU: i9-7940x
- RAM: 128G, 3200Hz
- GPU: 2 x Gefore 1080 ti
-
Docker
-
NVIDIA GPUs and driver. To test the correct installation on ubuntu, try:
nvidia-smi
-
NVIDIA docker tool kit. (installation script provided.)
bash nvidia_container_toolkit.bash
-
Your own KITTI's odometry dataset.
-
VSCode extensions
- Docker by Microsfot
- Remote Development by Microsoft
To quickly view the results, you do not need to run any model. The result data is provided in ~/src/src/Results/. To plot the result data, you can simply run:
# @ In the docker container,
export PYTHONPATH="/workspace/dvio$PYTHONPATH" >> ~/.bashrc
# @ src/Results in the docker container,
python plot_all.py
You'd still need to run the model. See Step 8 in the "Training and Testing Usage:" section.
-
Clone this repo.
git clone https://github.com/ElliotHYLee/Deep_Visual_Inertial_Odometry --recursive
-
A folder structure for KITTI dataset is provided. Fill in the actual data (images) accordingly. Or, provide custom bind mount path. To investigate the folder structure, see ~/datasets/KITTI/odom/sequences/00/image_0/
-
Build docker image
docker compose build
-
Run docker container
docker compose up -d
-
Using the VSCode extensions, attach the VSCode for the created container.
-
Put the sample weight uner the src/Weights. Sample weight link: https://drive.google.com/file/d/1DZL-MtMenJb23uQdjwQ_XuyonehuoovE/view?usp=drive_link
-
Training & Testing Make sure to turn on/off the training @ main_cnn.py. To run training, set TestOnly=False. Default is true. This will trian and generate weights if you don't have one.
# main_cnn.py runTrainTest('kitti', 'none', seq=[0, 2, 4], seqRange=[0, 11], TestOnly=False)
python main_cnn.py
python main_realtime.py
-
Testing CNN-KF output
python main_kf.py
Training result on KITTI odometry dataset on sequence 0 (Trained on seq: 0, 2, 4)
Test result on KITTI odom. data: seq.5
From left to right, velocity, position XYZ, position 2D. Red: ground truth, blue: CNN output, green: Kalman-Filter(CNN + Accelerometer)
Note As mentioned earlier, this project corrects the CNN output of the velocity using accelerometer's integration by Kalman filter. The positions are simple integrations on XYZ velocity. From 2nd graph's z axis, if lucky, the simple position integration may result in less drift.
To ultimately reduce the position, you will need to bring your own position measurement. i.e SLAM.