Home

Awesome

PWC PWC PWC

Learning to Compose Hypercolumns for Visual Correspondence

This is the implementation of the paper "Learning to Compose Hypercolumns for Visual Correspondence" by J. Min, J. Lee, J. Ponce and M. Cho. Implemented on Python 3.7 and PyTorch 1.0.1.

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

Requirements

Conda environment settings:

conda create -n dhpf python=3.7
conda activate dhpf

conda install pytorch=1.0.1 torchvision cudatoolkit=10.0 -c pytorch
pip install tensorboardX
conda install -c anaconda scipy
conda install -c anaconda pandas
conda install -c anaconda requests
conda install -c anaconda scikit-image
conda install -c anaconda "pillow<7"

Training

Training DHPF with <b>strong supervision</b> (keypoint annotations) on PF-PASCAL and SPair-71k</br> (reproducing strongly-supervised results in Tab. 1 and 2):

python train.py --supervision strong \
                --lr 0.03 \
                --bsz 8 \
                --niter 100 \
                --selection 0.5 \ 
                --benchmark pfpascal \ 
                --backbone {resnet50, resnet101}

python train.py --supervision strong \
                --lr 0.03 \
                --bsz 8 \
                --niter 5 \
                --selection 0.5 \ 
                --benchmark spair \ 
                --backbone {resnet50, resnet101}

Training DHPF with <b>weak supervision</b> (image-level labels) on PF-PASCAL</br> (reproducing weak-supervised results in Tab. 1):

python train.py --supervision weak \
                --lr 0.1 \
                --bsz 4 \
                --niter 30 \
                --selection 0.5 \  
                --benchmark pfpascal \
                --backbone {resnet50, resnet101}

Testing

We provide trained models available on [Google drive].

PCK @ α<sub>img</sub>=0.1 on PF-PASCAL at different μ:

Trained models<br>at differnt μ0.30.40.50.60.70.80.91
weak (res50)77.3797979.379.680.781.180.7
weak (res101)80.381.282.180.181.780.981.381.3
strong (res50)87.789.188.988.589.489.18989.5
strong (res101)88.79090.790.290.190.690.690.4

PCK @ α<sub>img</sub>=0.1 on SPair-71k at μ=0.5:

Trained models<br>at μ=0.5PCK
weak (res101)27.7
strong (res101)37.3

Reproducing results in Tab. 1, 2 and 3:

python test.py --backbone {resnet50, resnet101} \
               --benchmark {pfpascal, pfwillow, caltech, spair} \
               --load "path_to_trained_model"

BibTeX

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

@InProceedings{min2020dhpf, 
   title={Learning to Compose Hypercolumns for Visual Correspondence},
   author={Juhong Min and Jongmin Lee and Jean Ponce and Minsu Cho},
   booktitle={ECCV},
   year={2020}
}