GMFlow: Learning Optical Flow via Global Matching

Related tags

Deep Learning gmflow
Overview
Comments
  • Reproducing results for KITTI

    Reproducing results for KITTI

    Hi.

    Thanks for the nice work! I'm trying to reproduce the results for KITTI dataset reported in Table 4. Can you please tell me which pretrained weights and the hyperparameters I should use in order to obtain the best results?

    Also, I'm planning to evaluate GMFlow on HPatches and ETH3D as well. For this, can you tell me , in order to obtain the best results, which weights and hyperparameters I should select?

    I will be waiting for your reply! Thanks!

    opened by SunghwanHong 12
  • About the modifications related to stereo matching task

    About the modifications related to stereo matching task

    I'm curious to use GMFlow for stereo matching task. I noticed the closed issue #13 where you suggested to replace 2D cross-attention in Transformers with 1D cross-attention and 2D global matching with 1D global matching.

    Using Stereo-RAFT 1D correlation as a model I did manage to implement somehow 1D global matching but not sure at all if it is right or wrong (didn't manage to include pred_bidir_flow parameter).

    def coords_grid(b, h, w):
        y, x = torch.meshgrid(torch.arange(h), torch.arange(w))  # [H, W]
        stacks = [x, y]
        grid = torch.stack(stacks, dim=0).float()  # [2, H, W] or [3, H, W]
        grid = grid[None].repeat(b, 1, 1, 1)  # [B, 2, H, W] or [B, 3, H, W]
        return grid
    
    def global_correlation_softmax_1d(feature0, feature1):
        # global correlation
        b, c, h, w = feature0.shape
    
        feature0 = feature0.permute(0, 2, 3, 1)
        feature1 = feature1.permute(0, 2, 1, 3)
    
        corr = torch.matmul(feature0, feature1) / (c ** 0.5) # [B, H, W, W]
    
        # flow from softmax
        init_grid = coords_grid(b, h, w).to(corr.device)  # [B, 2, H, W]
        grid = init_grid.permute(0, 2, 3, 1)  # [B, H*W, 2]
    
        prob = F.softmax(corr, dim=-1)  # [B, H, W, W]
    
        correspondence = torch.matmul(prob, grid).permute(0, 3, 1, 2)  # [B, 2, H, W]
    
        # when predicting bidirectional flow, flow is the concatenation of forward flow and backward flow
        flow = correspondence - init_grid
    
        return flow
    

    For the 2D cross-attention replacement with 1D variant I don't know exactly which function I should modify. I assume that modifications should be done in single_head_split_window_attention() function but no idea how.

    I also noticed that the results of GMStereo is added to Middlebury stereo evalutation. Are you planning to release codes related to that project (this would solve automatically my issues related to modifications)?

    opened by tholmb 10
  • 关于相似度矩阵

    关于相似度矩阵

    您好,您在计算相似度矩阵时是直接将特征向量进行点积运算得到相似性矩阵。我把特征向量进行了归一化处理(每个像素点特征向量的模归一化为1),然后将归一化后的特征向量进行点积运算得到相似性矩阵,相似性矩阵没有再除以c**0.5。理论上这样处理应该是可行的呀,特征之间计算相似度去除了特征向量本身长度的影响。但是我这样处理后,loss降不下去。请问您有什么建议吗?或者说我这样处理本身就不对吗?

    opened by menghuaa 6
  • Questions about the training

    Questions about the training

    Hi, nice work! How did you determine the number of training iterations for each datasets? such as 800K for Things and 200K for Sintel. Is this the optimal number of iterations? How did you select and set them?

    opened by forbyme 5
  • about test

    about test

    您好,我使用您提供的指令CUDA_VISIBLE_DEVICES=0 python main.py
    --inference_dir demo/sintel_market_1
    --output_path output/gmflow-norefine-sintel_market_1
    --resume pretrained/gmflow_sintel-0c07dcb3.pth进行测试,sintel_market_1文件夹是您提供的图片,这个文件夹有三种图片,我删除了一张图片,只留下frame_0001.png和frame_0002.png。这个预测出来的光流,是frame_0001.png到frame_0002.png的光流吗?如果是这样的话,显示出的光流图根据颜色来看好像反了。

    opened by menghuaa 4
  • Flow Propagation in GMFlow (CVPR22) vs Flow Field Deformation in LiteFlowNet3 (ECCV20)

    Flow Propagation in GMFlow (CVPR22) vs Flow Field Deformation in LiteFlowNet3 (ECCV20)

    Congratulations on your new work!

    I think the idea of flow propagation in GMFlow is similar to the flow field deformation in LiteFlowNet3. Both of us propagate flow predictions and measure feature self-similarity. However, LiteFlowNet3 was not cited in GMFlow.

    opened by twhui 4
  • detail of GMFlow+

    detail of GMFlow+

    Hi, Thanks for the great code! I find that there is GMFlow+ on the Sintel benchmark. It says GMFlow+ is a straightforward extention of GMFlow and achieves significant results. Could you give some details about GMFlow+ or the difference between GMFlow+ and GMFlow? Besides, I wonder whether the code of GMFlow+ will be released. Thanks!

    opened by zwei-lin 3
  • About extension in Sintel leaderboard

    About extension in Sintel leaderboard

    First I must appreciate that you opened public code for your novel work.

    I have a question about your score on the official MPISintel leaderboard.

    According to an official paper published in CVPR2022, GMFlow's AEPE for Sintel clean and final test set was 1.74 and 2.90 but in the official leaderboard, GMFlow+'s AEPE is 1.028 and 2.367 for Sintel clean and final test set.

    Can you tell me which extension added for GMFlow leads to such extreme performance improvement?

    opened by Euiyeon-Kim 2
  • question about FeatureFlowAttention: flow.detach()

    question about FeatureFlowAttention: flow.detach()

    Code snippets: flow = self.feature_flow_attn(feature0, flow.detach(), local_window_attn=prop_radius > 0, local_window_radius=prop_radius)

    I'm curious about the flow.detach(). What was your idea for that design? I guess multipath backpropagation affects optimization performance, but I don't know if it's right.

    opened by mansang127 2
  • 不支持直接推理视频流

    不支持直接推理视频流

    您好,感谢您慷慨地将此工作设置为开放获取。

    我发现目前的版本似乎不支持直接对视频流进行推理。我不得不 video2images + Img2Video 后来获得视频流的光流结果。 如果能增加对视频流的实时推理将更好(这对GMFlow似乎是有难度的)。我在RTX3060上对651张图片进行了推理,耗时420.8246901035309秒。FlowNet2似乎能做到实时(从他们的演示视频上来看)。

    这只是一个友好的建议,感谢将该工作开源。

    opened by AlanLi1997 2
  • 关于训练策略

    关于训练策略

    大佬您好

    我想向您请教一下

    【1】您的训练流程是不是和train_gmflow.sh或train_gmflow_with_refine.sh一样:先在chairs上训练,然后在Things上微调,然后在sintel上微调,然后在kitti上微调。这4个数据集都需要跑一遍,而且是一环扣一环呢?

    【2】这4个数据集都跑一遍(在4张V100上)需要多长时间呢?我目前的设备是5张3090

    祝好!!!

    opened by klinic 2
Owner
Haofei Xu
3D Vision
Haofei Xu
Unsupervised Learning of Multi-Frame Optical Flow with Occlusions

This is a Pytorch implementation of Janai, J., Güney, F., Ranjan, A., Black, M. and Geiger, A., Unsupervised Learning of Multi-Frame Optical Flow with

Anurag Ranjan 110 Nov 2, 2022
A project that uses optical flow and machine learning to detect aimhacking in video clips.

waldo-anticheat A project that aims to use optical flow and machine learning to visually detect cheating or hacking in video clips from fps games. Che

waldo.vision 542 Dec 3, 2022
A project that uses optical flow and machine learning to detect aimhacking in video clips.

waldo-anticheat A project that aims to use optical flow and machine learning to visually detect cheating or hacking in video clips from fps games. Che

waldo.vision 383 Nov 1, 2021
UnFlow: Unsupervised Learning of Optical Flow with a Bidirectional Census Loss

UnFlow: Unsupervised Learning of Optical Flow with a Bidirectional Census Loss This repository contains the TensorFlow implementation of the paper UnF

Simon Meister 270 Nov 6, 2022
Code for C2-Matching (CVPR2021). Paper: Robust Reference-based Super-Resolution via C2-Matching.

C2-Matching (CVPR2021) This repository contains the implementation of the following paper: Robust Reference-based Super-Resolution via C2-Matching Yum

Yuming Jiang 151 Dec 26, 2022
A lightweight deep network for fast and accurate optical flow estimation.

FastFlowNet: A Lightweight Network for Fast Optical Flow Estimation The official PyTorch implementation of FastFlowNet (ICRA 2021). Authors: Lingtong

Tone 161 Jan 3, 2023
Pytorch implementation of FlowNet 2.0: Evolution of Optical Flow Estimation with Deep Networks

flownet2-pytorch Pytorch implementation of FlowNet 2.0: Evolution of Optical Flow Estimation with Deep Networks. Multiple GPU training is supported, a

NVIDIA Corporation 2.8k Dec 27, 2022
a reimplementation of Optical Flow Estimation using a Spatial Pyramid Network in PyTorch

pytorch-spynet This is a personal reimplementation of SPyNet [1] using PyTorch. Should you be making use of this work, please cite the paper according

Simon Niklaus 269 Jan 2, 2023
A fast model to compute optical flow between two input images.

DCVNet: Dilated Cost Volumes for Fast Optical Flow This repository contains our implementation of the paper: @InProceedings{jiang2021dcvnet, title={

Huaizu Jiang 8 Sep 27, 2021
Demo code for ICCV 2021 paper "Sensor-Guided Optical Flow"

Sensor-Guided Optical Flow Demo code for "Sensor-Guided Optical Flow", ICCV 2021 This code is provided to replicate results with flow hints obtained f

null 10 Mar 16, 2022
MMFlow is an open source optical flow toolbox based on PyTorch

Documentation: https://mmflow.readthedocs.io/ Introduction English | 简体中文 MMFlow is an open source optical flow toolbox based on PyTorch. It is a part

OpenMMLab 688 Jan 6, 2023
Traditional deepdream with VQGAN+CLIP and optical flow. Ready to use in Google Colab

VQGAN-CLIP-Video cat.mp4 policeman.mp4 schoolboy.mp4 forsenBOG.mp4

null 23 Oct 26, 2022
[CVPR 2022] Deep Equilibrium Optical Flow Estimation

Deep Equilibrium Optical Flow Estimation This is the official repo for the paper Deep Equilibrium Optical Flow Estimation (CVPR 2022), by Shaojie Bai*

CMU Locus Lab 136 Dec 18, 2022
Just Go with the Flow: Self-Supervised Scene Flow Estimation

Just Go with the Flow: Self-Supervised Scene Flow Estimation Code release for the paper Just Go with the Flow: Self-Supervised Scene Flow Estimation,

Himangi Mittal 50 Nov 22, 2022
A Python implementation of the Locality Preserving Matching (LPM) method for pruning outliers in image matching.

LPM_Python A Python implementation of the Locality Preserving Matching (LPM) method for pruning outliers in image matching. The code is established ac

AoxiangFan 11 Nov 7, 2022
Decentralized Reinforcment Learning: Global Decision-Making via Local Economic Transactions (ICML 2020)

Decentralized Reinforcement Learning This is the code complementing the paper Decentralized Reinforcment Learning: Global Decision-Making via Local Ec

null 40 Oct 30, 2022
A Pytorch implementation of "Manifold Matching via Deep Metric Learning for Generative Modeling" (ICCV 2021)

Manifold Matching via Deep Metric Learning for Generative Modeling A Pytorch implementation of "Manifold Matching via Deep Metric Learning for Generat

null 69 Dec 10, 2022
PyTorch implementation of SMODICE: Versatile Offline Imitation Learning via State Occupancy Matching

SMODICE: Versatile Offline Imitation Learning via State Occupancy Matching This is the official PyTorch implementation of SMODICE: Versatile Offline I

Jason Ma 14 Aug 30, 2022
Puzzle-CAM: Improved localization via matching partial and full features.

Puzzle-CAM The official implementation of "Puzzle-CAM: Improved localization via matching partial and full features".

Sanghyun Jo 150 Nov 14, 2022