Official PyTorch Implementation of Convolutional Hough Matching Networks, CVPR 2021 (oral)

Overview

PWC
PWC
PWC

Convolutional Hough Matching Networks

This is the implementation of the paper "Convolutional Hough Matching Network" by J. Min and M. Cho. Implemented on Python 3.7 and PyTorch 1.3.1.

For more information, check out project [website] and the paper on [arXiv]

Overall architecture:

Requirements

  • Python 3.7
  • PyTorch 1.3.1
  • cuda 10.1
  • pandas
  • requests

Conda environment settings:

conda create -n chm python=3.7
conda activate chm

conda install pytorch=1.3.1 torchvision cudatoolkit=10.1 -c pytorch
conda install -c anaconda requests
conda install -c conda-forge tensorflow
pip install tensorboardX
conda install -c anaconda pandas

Training

The code provides three types of CHM kernel: position-sensitive isotropic (psi), isotropic (iso), vanilla Nd (full).

python train.py --ktype {psi, iso, full} 
                --benchmark {spair, pfpascal}

Testing

Trained models are available on [Google drive].

python test.py --ktype {psi, iso, full} 
               --benchmark {spair, pfpascal, pfwillow} 
               --load 'path_to_trained_model'

For example, to reproduce our results in Table 1, refer following scripts.

python test.py --ktype psi --benchmark spair --load 'path_to_trained_model/spr_psi.pt'
python test.py --ktype psi --benchmark spair --load 'path_to_trained_model/pas_psi.pt'
python test.py --ktype psi --benchmark pfpascal --load 'path_to_trained_model/pas_psi.pt'
python test.py --ktype psi --benchmark pfwillow --load 'path_to_trained_model/pas_psi.pt'

BibTeX

If you use this code for your research, please consider citing:

@InProceedings{min2021chm, 
    author    = {Min, Juhong and Cho, Minsu},
    title     = {Convolutional Hough Matching Networks},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    month     = {June},
    year      = {2021},
    pages     = {2940-2950}
}
Comments
  • Can't find 'test_pairs.csv' in pf-pascal datasets

    Can't find 'test_pairs.csv' in pf-pascal datasets

    when I run the test.py on pf-pascal dataset, it error with FileNotFoundError: [Errno 2] No such file or directory: '/home/xx/chm/Datasets/PF-PASCAL/test_pairs.csv'. The pf-pascal dataset I used is downloaded from https://www.di.ens.fr/willow/research/proposalflow/. The url of pf-pascal dataset in download.py cannot connected, https://docs.google.com/uc?export=download?id=1OOwpGzJnTsFXYh-YffMQ9XKM_Kl_zdzg return 400.

    opened by aruba01 6
  • Issue with conda settings

    Issue with conda settings

    Created conda environment with python=3.7, I tried all available versions of pytorch=1.3.1 (paired with fixed torchvision=0.4.2 version) with different cudatoolkit versions (9.2, 10.0, 10.1 ) it seems like there's some problem between torchvision0.4.2 and PIL, causing a failure in importing torchvision properly.

    Then I tried

    conda install pytorch=1.4.1 torchvision cudatoolkit=10.1 -c pytorch
    

    it worked and but the results I got are quite different.

    I wonder what pytorch versions and cudatoolkit versions are recommended.

    opened by Brahmagupta 5
  • A question about test.csv of PF-WILLOW

    A question about test.csv of PF-WILLOW

    Hello! when I run the test.py on pf-willow dataset, it error with FileNotFoundError: [Errno 2] No such file or directory: '/home/xx/chm/Datasets/PF-WILLOW/test_pairs.csv'. The PF-WILLOW dataset I used is downloaded from https://www.di.ens.fr/willow/research/proposalflow/. Please help me ! Please!

    opened by senerit 4
  • Using new weights

    Using new weights

    Hello @juhongm999 !

    Thank you for such great work.

    I am experiencing an issue with the new weights located on your google drive.

    If I try to use them with pytorch 1.3.1 I get the following error:

    ValueError                                Traceback (most recent call last)
    ~/.anaconda3/envs/chm/lib/python3.7/tarfile.py in nti(s)
        186             s = nts(s, "ascii", "strict")
    --> 187             n = int(s.strip() or "0", 8)
        188         except ValueError:
    
    ValueError: invalid literal for int() with base 8: '_tensor_'
     ...
    ~/.anaconda3/envs/chm/lib/python3.7/site-packages/torch/serialization.py in _load(f, map_location, pickle_module, **pickle_load_args)
        597             if _is_zipfile(f):
        598                 # .zip is used for torch.jit.save and will throw an un-pickling error here
    --> 599                 raise RuntimeError("{} is a zip archive (did you mean to use torch.jit.load()?)".format(f.name))
        600             # if not a tarfile, reset file offset and proceed
        601             f.seek(0)
    
    RuntimeError: pas_psi.pt is a zip archive (did you mean to use torch.jit.load()?)
    

    The full error could be found here.

    But if I use the 1.8.1 version of pytorch I get the following error.

      Missing key(s) in state_dict: "learner.conv2ds.0.weight", "learner.conv2ds.1.weight", "learner.conv2ds.2.weight", "learner.chm6d.bias", "learner.chm6d.param". 
    	  Unexpected key(s) in state_dict: "learner.conv2ds.0.0.weight", "learner.conv2ds.0.1.weight", "learner.conv2ds.0.2.weight", "learner.chm6d.0.bias", "learner.chm6d.0.param.0", "learner.chm6d.0.param.1", "learner.chm6d.0.param.2", "learner.chm6d.0.param.3". 
    	  size mismatch for learner.chm4d.weight: copying a param with shape torch.Size([55]) from checkpoint, the shape in current model is torch.Size([1, 1, 5, 5, 5, 5]).
    
    

    I believe this happens because the weights are for a slightly newer network, then the one currently in the repo. Is there any chance you could update the network in the repository ?

    Thanks in advance, Arseny

    opened by Arseny-N 2
  • Can't download dataset  'pfpascal' and 'spair'

    Can't download dataset 'pfpascal' and 'spair'

    Hi @juhongm999, Thanks for your great work.

    When I run the train.py on pfpascal and spair, respectively, it errors with OSError: Not a gzipped file (b'<!') and tarfile.ReadError: not a gzip file. I think the error occurs line 44 in download.py.

    Could you check it?

    the command I did : python train.py --ktype psi --benchmark spair

    opened by OMEGA-Y 1
  • Visualization results

    Visualization results

    Hi @juhongm999 ,

    Thanks for your great work. I want to reproduce your results and visualization. How can we draw images of correspondence between 2 images? (e.g. cat images in Figure 1 of your paper). Do you have any implementation for that? Thanks!!

    Best, Hai

    opened by haithanhp 1
Owner
Juhong Min
research interest in computer vision
Juhong Min
Focal Sparse Convolutional Networks for 3D Object Detection (CVPR 2022, Oral)

Focal Sparse Convolutional Networks for 3D Object Detection (CVPR 2022, Oral) This is the official implementation of Focals Conv (CVPR 2022), a new sp

DV Lab 280 Jan 7, 2023
Official pytorch implementation of paper "Inception Convolution with Efficient Dilation Search" (CVPR 2021 Oral).

IC-Conv This repository is an official implementation of the paper Inception Convolution with Efficient Dilation Search. Getting Started Download Imag

Jie Liu 111 Dec 31, 2022
Official PyTorch implementation of RobustNet (CVPR 2021 Oral)

RobustNet (CVPR 2021 Oral): Official Project Webpage Codes and pretrained models will be released soon. This repository provides the official PyTorch

Sungha Choi 173 Dec 21, 2022
This repository implements and evaluates convolutional networks on the Möbius strip as toy model instantiations of Coordinate Independent Convolutional Networks.

Orientation independent Möbius CNNs This repository implements and evaluates convolutional networks on the Möbius strip as toy model instantiations of

Maurice Weiler 59 Dec 9, 2022
Pytorch implementation for "Adversarial Robustness under Long-Tailed Distribution" (CVPR 2021 Oral)

Adversarial Long-Tail This repository contains the PyTorch implementation of the paper: Adversarial Robustness under Long-Tailed Distribution, CVPR 20

Tong WU 89 Dec 15, 2022
Official code for the paper: Deep Graph Matching under Quadratic Constraint (CVPR 2021)

QC-DGM This is the official PyTorch implementation and models for our CVPR 2021 paper: Deep Graph Matching under Quadratic Constraint. It also contain

Quankai Gao 55 Nov 14, 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
ICCV2021 Oral SA-ConvONet: Sign-Agnostic Optimization of Convolutional Occupancy Networks

Sign-Agnostic Convolutional Occupancy Networks Paper | Supplementary | Video | Teaser Video | Project Page This repository contains the implementation

null 63 Nov 18, 2022
ICCV2021 Oral SA-ConvONet: Sign-Agnostic Optimization of Convolutional Occupancy Networks

Sign-Agnostic Convolutional Occupancy Networks Paper | Supplementary | Video | Teaser Video | Project Page This repository contains the implementation

null 64 Jan 5, 2023
(CVPR 2022 Oral) Official implementation for "Surface Representation for Point Clouds"

RepSurf - Surface Representation for Point Clouds [CVPR 2022 Oral] By Haoxi Ran* , Jun Liu, Chengjie Wang ( * : corresponding contact) The pytorch off

Haoxi Ran 264 Dec 23, 2022
Official MegEngine implementation of CREStereo(CVPR 2022 Oral).

[CVPR 2022] Practical Stereo Matching via Cascaded Recurrent Network with Adaptive Correlation This repository contains MegEngine implementation of ou

MEGVII Research 309 Dec 30, 2022
Official pytorch implementation of "Feature Stylization and Domain-aware Contrastive Loss for Domain Generalization" ACMMM 2021 (Oral)

Feature Stylization and Domain-aware Contrastive Loss for Domain Generalization This is an official implementation of "Feature Stylization and Domain-

null 22 Sep 22, 2022
Implementation of "Bidirectional Projection Network for Cross Dimension Scene Understanding" CVPR 2021 (Oral)

Bidirectional Projection Network for Cross Dimension Scene Understanding CVPR 2021 (Oral) [ Project Webpage ] [ arXiv ] [ Video ] Existing segmentatio

Hu Wenbo 135 Dec 26, 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
Pytorch implementation for "Large-Scale Long-Tailed Recognition in an Open World" (CVPR 2019 ORAL)

Large-Scale Long-Tailed Recognition in an Open World [Project] [Paper] [Blog] Overview Open Long-Tailed Recognition (OLTR) is the author's re-implemen

Zhongqi Miao 761 Dec 26, 2022
Official code for our CVPR '22 paper "Dataset Distillation by Matching Training Trajectories"

Dataset Distillation by Matching Training Trajectories Project Page | Paper This repo contains code for training expert trajectories and distilling sy

George Cazenavette 256 Jan 5, 2023
PyTorch implementation of Graph Convolutional Networks in Feature Space for Image Deblurring and Super-resolution, IJCNN 2021.

GCResNet PyTorch implementation of Graph Convolutional Networks in Feature Space for Image Deblurring and Super-resolution, IJCNN 2021. The code will

null 11 May 19, 2022
Official code for "End-to-End Optimization of Scene Layout" -- including VAE, Diff Render, SPADE for colorization (CVPR 2020 Oral)

End-to-End Optimization of Scene Layout Code release for: End-to-End Optimization of Scene Layout CVPR 2020 (Oral) Project site, Bibtex For help conta

Andrew Luo 41 Dec 9, 2022
Official repository for HOTR: End-to-End Human-Object Interaction Detection with Transformers (CVPR'21, Oral Presentation)

Official PyTorch Implementation for HOTR: End-to-End Human-Object Interaction Detection with Transformers (CVPR'2021, Oral Presentation) HOTR: End-to-

Kakao Brain 114 Nov 28, 2022