All Projects → haofeixu → flow1d

haofeixu / flow1d

Licence: MIT license
[ICCV 2021 Oral] High-Resolution Optical Flow from 1D Attention and Correlation

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to flow1d

CorrelationLayer
Pure Pytorch implementation of Correlation Layer that commonly used in learning based optical flow estimator
Stars: ✭ 22 (-75.82%)
Mutual labels:  correlation, optical-flow
TRAR-VQA
[ICCV 2021] TRAR: Routing the Attention Spans in Transformers for Visual Question Answering -- Official Implementation
Stars: ✭ 49 (-46.15%)
Mutual labels:  attention, iccv2021
mmflow
OpenMMLab optical flow toolbox and benchmark
Stars: ✭ 711 (+681.32%)
Mutual labels:  optical-flow
Deep-Matching-Prior
Official implementation of deep matching prior
Stars: ✭ 21 (-76.92%)
Mutual labels:  iccv2021
MSRGCN
Official implementation of MSR-GCN (ICCV2021 paper)
Stars: ✭ 42 (-53.85%)
Mutual labels:  iccv2021
chinese ancient poetry
seq2seq attention tensorflow textrank context
Stars: ✭ 30 (-67.03%)
Mutual labels:  attention
CrowdFlow
Optical Flow Dataset and Benchmark for Visual Crowd Analysis
Stars: ✭ 87 (-4.4%)
Mutual labels:  optical-flow
how attentive are gats
Code for the paper "How Attentive are Graph Attention Networks?" (ICLR'2022)
Stars: ✭ 200 (+119.78%)
Mutual labels:  attention
InstanceRefer
[ICCV 2021] InstanceRefer: Cooperative Holistic Understanding for Visual Grounding on Point Clouds through Instance Multi-level Contextual Referring
Stars: ✭ 64 (-29.67%)
Mutual labels:  iccv2021
keras-utility-layer-collection
Collection of custom layers and utility functions for Keras which are missing in the main framework.
Stars: ✭ 63 (-30.77%)
Mutual labels:  attention
natural-language-joint-query-search
Search photos on Unsplash based on OpenAI's CLIP model, support search with joint image+text queries and attention visualization.
Stars: ✭ 143 (+57.14%)
Mutual labels:  attention
tensorflow-chatbot-chinese
網頁聊天機器人 | tensorflow implementation of seq2seq model with bahdanau attention and Word2Vec pretrained embedding
Stars: ✭ 50 (-45.05%)
Mutual labels:  attention
Im2LaTeX
An implementation of the Show, Attend and Tell paper in Tensorflow, for the OpenAI Im2LaTeX suggested problem
Stars: ✭ 16 (-82.42%)
Mutual labels:  attention
Foveation-Segmentation
PyTorch implementation of Foveation for Segmentation of Ultra-High Resolution Images
Stars: ✭ 38 (-58.24%)
Mutual labels:  high-resolution
attention-ocr
A pytorch implementation of the attention based ocr
Stars: ✭ 44 (-51.65%)
Mutual labels:  attention
reasoning attention
Unofficial implementation algorithms of attention models on SNLI dataset
Stars: ✭ 34 (-62.64%)
Mutual labels:  attention
SnowflakeNet
(TPAMI 2022) Snowflake Point Deconvolution for Point Cloud Completion and Generation with Skip-Transformer
Stars: ✭ 74 (-18.68%)
Mutual labels:  iccv2021
LLVIP
LLVIP: A Visible-infrared Paired Dataset for Low-light Vision
Stars: ✭ 438 (+381.32%)
Mutual labels:  iccv2021
AiR
Official Repository for ECCV 2020 paper "AiR: Attention with Reasoning Capability"
Stars: ✭ 41 (-54.95%)
Mutual labels:  attention
GuidedNet
Caffe implementation for "Guided Optical Flow Learning"
Stars: ✭ 28 (-69.23%)
Mutual labels:  optical-flow

Flow1D

Official PyTorch implementation of paper:

High-Resolution Optical Flow from 1D Attention and Correlation, ICCV 2021, Oral

Authors: Haofei Xu, Jiaolong Yang, Jianfei Cai, Juyong Zhang, Xin Tong

11/15/2022 Update: Check out our new work: Unifying Flow, Stereo and Depth Estimation and code: unimatch for estimating optical flow with our new GMFlow model. 9 pretrained GMFlow models with different speed-accuray trade-offs are also released. Check out our Colab and HuggingFace demo to play with GMFlow in your browser!

We enabled 4K resolution optical flow estimation by factorizing 2D optical flow with 1D attention and 1D correlation.

The full framework:

Installation

Our code is based on pytorch 1.7.1, CUDA 10.2 and python 3.7. Higher version pytorch should also work well.

We recommend using conda for installation:

conda env create -f environment.yml
conda activate flow1d

Demos

All pretrained models can be downloaded from google drive.

You can run a trained model on a sequence of images and visualize the results (as shown in scripts/demo.sh):

CUDA_VISIBLE_DEVICES=0 python main.py \
--resume pretrained/flow1d_highres-e0b98d7e.pth \
--val_iters 24 \
--inference_dir demo/dogs-jump \
--output_path output/flow1d-dogs-jump

Datasets

The datasets used to train and evaluate Flow1D are as follows:

By default the dataloader datasets.py assumes the datasets are located in folder datasets and are organized as follows:

datasets
├── FlyingChairs_release
│   └── data
├── FlyingThings3D
│   ├── frames_cleanpass
│   ├── frames_finalpass
│   └── optical_flow
├── HD1K
│   ├── hd1k_challenge
│   ├── hd1k_flow_gt
│   ├── hd1k_flow_uncertainty
│   └── hd1k_input
├── KITTI
│   ├── testing
│   └── training
├── Sintel
│   ├── test
│   └── training

It is recommended to symlink your dataset root to datasets:

ln -s $YOUR_DATASET_ROOT datasets

Otherwise, you may need to change the corresponding paths in datasets.py.

Evaluation

You can evaluate a trained Flow1D model by running:

CUDA_VISIBLE_DEVICES=0 python main.py --eval --val_dataset kitti --resume pretrained/flow1d_things-fd4bee1f.pth --val_iters 24

More evaluation scripts can be found in scripts/evaluate.sh.

Training

All training scripts on FlyingChairs, FlyingThings3D, Sintel and KITTI datasets can be found in scripts/train.sh.

Note that our Flow1D model can be trained on a single 32GB V100 GPU. You may need to tune the number of GPUs used for training according to your hardware.

We support using tensorboard to monitor and visualize the training process. You can first start a tensorboard session with

tensorboard --logdir checkpoints

and then access http://localhost:6006 in your browser.

Citation

If you find our work useful in your research, please consider citing our paper:

@inproceedings{xu2021high,
  title={High-Resolution Optical Flow from 1D Attention and Correlation},
  author={Xu, Haofei and Yang, Jiaolong and Cai, Jianfei and Zhang, Juyong and Tong, Xin},
  booktitle={Proceedings of the IEEE/CVF International Conference on Computer Vision},
  pages={10498--10507},
  year={2021}
}

Acknowledgements

This project is heavily based on RAFT. We thank the original authors for their excellent work.

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