antoninodimaggio / Voof

Licence: MIT license
Visual odometry using optical flow and neural networks

Programming Languages

python
139335 projects - #7 most used programming language
Cuda
1817 projects
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to Voof

highway-path-planning
My path-planning pipeline to navigate a car safely around a virtual highway with other traffic.
Stars: ✭ 39 (-33.9%)
Mutual labels:  autonomous-vehicles
Optical-Flow-GPU-Docker
Compute dense optical flow using TV-L1 algorithm with NVIDIA GPU acceleration.
Stars: ✭ 48 (-18.64%)
Mutual labels:  optical-flow
rgbd odometry
No description or website provided.
Stars: ✭ 22 (-62.71%)
Mutual labels:  visual-odometry
self-driving-car
Implementation of the paper "End to End Learning for Self-Driving Cars"
Stars: ✭ 54 (-8.47%)
Mutual labels:  autonomous-vehicles
Face-Detection-and-Tracking
Face Detection and tracking using CamShift, Kalman Filter, Optical Flow
Stars: ✭ 30 (-49.15%)
Mutual labels:  optical-flow
odometry
Training Deep SLAM on Single Frames https://arxiv.org/abs/1912.05405
Stars: ✭ 38 (-35.59%)
Mutual labels:  visual-odometry
BridgeDepthFlow
Bridging Stereo Matching and Optical Flow via Spatiotemporal Correspondence, CVPR 2019
Stars: ✭ 114 (+93.22%)
Mutual labels:  optical-flow
flow-io-opencv
Fork and OpenCV wrapper of the optical flow I/O and visualization code provided as part of the Sintel dataset [1].
Stars: ✭ 20 (-66.1%)
Mutual labels:  optical-flow
vision-based estimations
Vision-based Robot 3D Pose and Velocities Estimations
Stars: ✭ 32 (-45.76%)
Mutual labels:  optical-flow
wasr network
WaSR Segmentation Network for Unmanned Surface Vehicles v0.5
Stars: ✭ 32 (-45.76%)
Mutual labels:  autonomous-vehicles
correlation flow
ROS package for Correlation Flow (ICRA 2018)
Stars: ✭ 28 (-52.54%)
Mutual labels:  optical-flow
PCLNet
Unsupervised Learning for Optical Flow Estimation Using Pyramid Convolution LSTM.
Stars: ✭ 29 (-50.85%)
Mutual labels:  optical-flow
SoftNet-SpotME
Shallow Optical Flow Three-Stream CNN For Macro and Micro-Expression Spotting From Long Videos
Stars: ✭ 17 (-71.19%)
Mutual labels:  optical-flow
SelfDrivingRCCar
Autonomous RC Car using Neural Networks, Python and Open CV
Stars: ✭ 102 (+72.88%)
Mutual labels:  autonomous-vehicles
Model-Predictive-Control
This project is to use Model Predictive Control (MPC) to drive a car in a game simulator. The server provides reference waypoints (yellow line in the demo video) via websocket, and we use MPC to compute steering and throttle commands to drive the car. The solution must be robust to 100ms latency, since it might encounter in real-world application.
Stars: ✭ 93 (+57.63%)
Mutual labels:  autonomous-vehicles
OpenpilotToolkit
Openpilot Toolkit (OPTK) is a class library and toolkit for interacting with your openpilot / commaai devices.
Stars: ✭ 55 (-6.78%)
Mutual labels:  commaai
EPPM
CUDA implementation of the paper "Fast Edge-Preserving PatchMatch for Large Displacement Optical Flow" in CVPR 2014.
Stars: ✭ 34 (-42.37%)
Mutual labels:  optical-flow
Auto-Birds-Eye
Bird's eye/Top Down view generation and mapping with deep learning.
Stars: ✭ 129 (+118.64%)
Mutual labels:  autonomous-vehicles
avatar-facial-landmark-detection
A method about optimizing the facial landmark detection based on Kalman Filter, Optical Flow and Dlib
Stars: ✭ 87 (+47.46%)
Mutual labels:  optical-flow
Tonic
An autonomous vehicle written in python
Stars: ✭ 85 (+44.07%)
Mutual labels:  autonomous-vehicles

Voof

Speed GIF

Speeds for this GIF generated using Method #1 (Full video)

Overview

A series of experiments attempting to predict vehicle speed from dash cam videos using optical flow and neural networks. Voof is short for video odometry using optical flow. A more thorough write-up can be found in this blog post.

Methods

Data

There is a dashcam video /data/train/train.mp4 that is accompanied by a text file /data/train/train.txt that contains the ground truth speed at each frame. I also managed to acquire a second video /data/train/test.mp4 along with /data/train/test.txt containing the ground truth speed at each frame. The test video is used to see how well the methods demonstrated can generalize. The train video comes from the comma.ai speed challenge, the test video also comes from comma.ai.

Optical Flow

Optical flow quantifies the apparent motion of objects between frames. Optical flow can also be defined as the distribution of apparent velocities of movement of brightness patterns in an image. Calculating the relative velocity of the vehicle directly from an optical flow field requires depth (this was not obviously apparent to me at first). In our case the only way to estimate depth would be to use another neural network, which is not a method I chose to explore (although I believe that it may hold promise in terms of generalization).

Video Preprocessing

With optical flow estimation in mind, the saturation of each pair of frames was augmented with the same uniform random variable to account for illumination changes that will severely deteriorate performance. The majority of the sky and car hood are then cropped since they do not really change between successive frames. The frames are then resized and interpolated to work with the CNN architecture. The image preprocessing remains the same for all methods used.

Augmented brightness demo

Final image demo

Method #1: Gunnar-Farneback Dense Optical Flow

Gunnar-Farnebeck is an optimization based method for estimating dense optical flow. Two successive frames are preprocessed and fed into the algorithm. The resulting two-dimensional optical flow field can then be turned into a 3 channel RGB image via the following method. This process is repeated for each pair of successive frames. The resulting RGB optical flow images are accompanied by their appropriate ground truth speeds and saved as a PyTorch dataset. All of the code for this can be found in preprocess_farneback.py.

Method #2: PWC-Net Dense Optical Flow

Optical flow has historically been an optimization problem, however neural networks have been shown to work better under certain conditions. I modified this PWC-Net implementation to work with modern PyTorch. I used the model, provided by the original authors, that was pre trained on the MPI Sintel dataset. The procedure is similar to that of Method #1, however the optical flow field is left in two-dimensions, since the output of PWC-Net is slightly different compared to that of Gunnar-Farneback. All of the code for this can be found in preprocess_pwc.py.

CNN Architecture

Once we have optical flow, we can then attempt to train a convolutional neural network to predict speed. Note that this is a regression task not a classification task (although it would be interesting to explore this problem as such). The CNN architecture is from the End-to-End Deep Learning for Self-Driving Cars blog post by NVIDIA.

CNN Arch

Training/Analysis

The models for both methods were trained in a very similar fashion. With 80% of the data reserved for training and 20% of the data for evaluation. It is important to note that the data was not randomly shuffled, since this does not preserve integrity between the training and evaluation sets. All of the training/evaluation code can be found in train_eval.py.

It turns out that these method works fairly well on the evaluation sets but do not generalize very well. I go more into depth on why I believe this occurs, as well as some of the other caveats in my blog post.

Loss

Previous Work

Contact

twitter

For questions/general discussion DM me on twitter.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].