All Projects → ClementPinard → FlowNetTorch

ClementPinard / FlowNetTorch

Licence: other
Torch implementation of Fischer et al. FlowNet training code

Programming Languages

lua
6591 projects

Projects that are alternatives of or similar to FlowNetTorch

inpainting FRRN
Progressive Image Inpainting (Kolmogorov Team solution for Huawei Hackathon 2019 summer)
Stars: ✭ 30 (+11.11%)
Mutual labels:  torch
torch-dataframe
Utility class to manipulate dataset from CSV file
Stars: ✭ 67 (+148.15%)
Mutual labels:  torch
neural-vqa-attention
❓ Attention-based Visual Question Answering in Torch
Stars: ✭ 96 (+255.56%)
Mutual labels:  torch
hypnettorch
Package for working with hypernetworks in PyTorch.
Stars: ✭ 66 (+144.44%)
Mutual labels:  torch
flambeau
Nim bindings to libtorch
Stars: ✭ 60 (+122.22%)
Mutual labels:  torch
Jetson-Nano-image
Jetson Nano image with deep learning frameworks
Stars: ✭ 46 (+70.37%)
Mutual labels:  torch
GuidedNet
Caffe implementation for "Guided Optical Flow Learning"
Stars: ✭ 28 (+3.7%)
Mutual labels:  flownet
torchlib
Data structures, algorithms, and ML/NLP tools in Lua.
Stars: ✭ 22 (-18.52%)
Mutual labels:  torch
sentence2vec
Deep sentence embedding using Sequence to Sequence learning
Stars: ✭ 23 (-14.81%)
Mutual labels:  torch
WassersteinGAN.torch
Torch implementation of Wasserstein GAN https://arxiv.org/abs/1701.07875
Stars: ✭ 48 (+77.78%)
Mutual labels:  torch
ALIGNet
code to train a neural network to align pairs of shapes without needing ground truth warps for supervision
Stars: ✭ 58 (+114.81%)
Mutual labels:  torch
deepOF
TensorFlow implementation for "Guided Optical Flow Learning"
Stars: ✭ 26 (-3.7%)
Mutual labels:  flownet
deep-learning-platforms
deep-learning platforms,framework,data(深度学习平台、框架、资料)
Stars: ✭ 17 (-37.04%)
Mutual labels:  torch
Captcha-Cracking
Crack number and Chinese captcha with both traditional and deep learning methods, based on Torch and python.
Stars: ✭ 35 (+29.63%)
Mutual labels:  torch
Cross-View-Gait-Based-Human-Identification-with-Deep-CNNs
Code for 2016 TPAMI(IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE) A Comprehensive Study on Cross-View Gait Based Human Identification with Deep CNNs
Stars: ✭ 21 (-22.22%)
Mutual labels:  torch
eccv16 attr2img
Torch Implemention of ECCV'16 paper: Attribute2Image
Stars: ✭ 93 (+244.44%)
Mutual labels:  torch
gan-reverser
Reversing GAN image generation for similarity search and error/artifact fixing
Stars: ✭ 13 (-51.85%)
Mutual labels:  torch
bittensor
Internet-scale Neural Networks
Stars: ✭ 97 (+259.26%)
Mutual labels:  torch
DeepCD
[ICCV17] DeepCD: Learning Deep Complementary Descriptors for Patch Representations
Stars: ✭ 39 (+44.44%)
Mutual labels:  torch
torch-pitch-shift
Pitch-shift audio clips quickly with PyTorch (CUDA supported)! Additional utilities for searching efficient transformations are included.
Stars: ✭ 70 (+159.26%)
Mutual labels:  torch

FlowNet for Torch

Summary

This repository is a torch implementation of FlowNet, by Alexey Dosovitskiy et al. in Torch

This code is mainly inspired from soumith's imagenet-multiGPU.torch , Flow file loader taken from artistic-videos. It has not been tested for multiple GPU, but it should work just as in soumith's code. You may have to modify the models specifications.

The code provides a training example, using the flying chair dataset , with data augmentation. An implementation for Scene Flow Datasets may be added in the future.

The four neural network models that are provided are :

  • FlowNetS
  • FlowNetSBN
  • FlowNetSGraph
  • FlowNetSBNGraph

FlowNetSGraph and FlowNetSBNGraph need nngraph to be used, and need graph to be displayed while FlowNetS and FlowNetSBN can be directly printed in console, but they are much simpler. We recommend using FlowNetSBNGraph, as it reaches a better EPE (End Point Error)

There is not current implementation of FlowNetC as a specific Correlation layer module would need to be written (feel free to contribute !)

Pretrained Models

Thanks to loadcaffe and Pauline Luc's commit , we were able to load pretrained caffe models in torch. If you don't want to install this unofficial pull request, you can get them directly here (float version) :

No training is currently provided for DispNet

Note on expected inputs ranges

the input is supposed to be BGR [0,1] for the caffe pretrained models. But in the end it does not really matter if you take RGB [0,1] or BGR [0,1], since during caffe training they did color warps as data augmentation.

Torch pretrained models however (with 'from_scratch' appended to the name) expects a normalized inputs as in the training code.

Training on Flying Chair Dataset

First, you need to download the the flying chair dataset . It is ~64GB big and we recommend you put in a SSD Drive.

Default HyperParameters provided in opts.lua are the same as in the caffe training scripts.

Example usage for FlowNetSGraph, fine tuning from FlowNetS_SmallDisp :

th main.lua -data /path/to/flying_chairs/ -batchSize 8 -nDonkeys 8 -netType FlowNetSBNGraph -nEpochs 80 -retrain model_flownet_finetuning.t7

We recommend you set nDonkeys (number of data threads) to high if you use DataAugmentation as to avoid data loading to slow the training.

For further help you can type

th main.lua -h

(as in Soumith's Original code)

Note on loss function : The training error used here, is the L1 Error (nn.AbsCriterion) whereas they say in the paper they used End Point Error (which is not the same as mean square error implementation provided by nn.MSECriterion). However the Criterion used in the code they provided is clearly the L1 criterion. We chose to use this criterion as an EPE criterion would require to hardcode a new criterion in CUDA. We also name it EPE instead of 'L1Error' to save space on CLI. Update : A real 'EPE' has been implemented here. As pointed by some, caffe code actually includes an EPE layer before Criterion. 'L1Error' is then used compared to a zero-filled array. We did the same thing here, while keeping inside a criterion, in order to have the same model specifications for both training and test. However, tests showed that convergence was not better.

Training Results

FlowNetS FlowNetSBN
train_result test_result
train_result test_result

Live Demo

Thanks to Sergey Zagoruyko's Torch OpenCV Demo , you can run a live demo using OpenCV bindings for torch It has been tested on a Quadro K2200M powered Laptop at ~3 fps using training input size (you can speed it up by reducing input size)

th liveDemo.lua --model FlowNetS_pretrained.t7 --input_height 256 --output_height 1200

The code is optimized for BGR [0,1] inputs (so for caffe pretrained networks), but still works decently for models from torch.

Update regarding flying chairs dataset.

the flying chair dataset is no longer using a list file, which made this implementation unable to retrieve image and flow files. The code has been updated to get it by itself (as the filenames follow a very regular pattern).

However, if you want to add your own image pairs to the dataset, the compatibility with the list file is keeped. You can grab a (maybe outdated) backup of list file here

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].