Giter Club home page Giter Club logo

demistfy_correspondence's Introduction

Demistfying Unsupervised Semantic Correspondence Estimation

main

Installation

git clone https://github.com/MehmetAygun/demistfy_correspondence
cd demistfy_correspondence
conda env create -f environment.yml
conda activate demistfy

Data

You can download the datasets that we consider in the paper from respective links: Spair, CUB, Stanforddogs, Awa-Pose, AFLW.

For evaluation, you need copy put random_pair.txt file from pairs directory to respective dataset folder. Final folder structure should be like below;

data_folder/dataset
└── .....
└── random_pair.txt

Evaluation

To evaluate a method, you need to run evaluate.py from respective dataset folder in the evaluation directory.

For instance to evaluate None projection (original embeddings)

python evaluate.py --layer 3 --logpath None

This will create a log file under logs directory, and in the end of the file you can find the metrics that we described in the paper.

To evaluate a finetuned unsupervised method you need to give use --projpath argument, and if you want to test another type of architecture like transofmer you need to give --model_type argument.

model_types are: resnet50, dino, vit

For instance to evalute asym using unsupervised transformer as a backbone for the CUB dataset, you should go to evalution/cub directory and run :

python evaluate.py --model_type dino --layer 3 --projpath path_to_cub_asym_projection --logpath dino_asym_cub

Training

To train a projection layer using unsupervised losses (eq,dve,lead,cl,asym) go to projection directory and run train.py script. You need to give datapath with --datapath argument, dataset with --dataset which can be : spair, stanforddogs, cub, awa, aflw To use unsupervised losses give as single argument without any parameter: for example --eq for training projection with EQ loss(other options are cl, asym, dve, lead).

If you do not give any parameter for unsupervised loses, the scripts trains projection with keypoint supervision.

You can also set batchsize, layers, weightdecay and model_type or initial weights for the backbone with model_weights argument.

For instance, to train a projection layer using ASYM loss on top of supervised CNN for the Stanforddogs dataset:

python train.py  --layer 3 --batchsize 8 --asym --dataset stanforddogs --datapath path_to_stanforddogs_dataset --logpath path_for_log

Trained Models

You can download the pretrained models from here

New PCK Metric and Detailed Analysis

errors

If you want to use our proposed version of PCK and detailed analysis the function is implemented here.

Citing

If you find the code useful in your research, please consider citing:

@inproceedings{aygun2022eccv,
    author    = {Aygun, Mehmet and Mac Aodha, Oisin},
    title     = {Demystifying Unsupervised Semantic Correspondence Estimation},
    booktitle = {European Conference on Computer Vision (ECCV)},
    year      = {2022}
}

Acknowledgements

We used partial code snippets from hpf, MiDaS and dino-vit-features.

demistfy_correspondence's People

Contributors

mehmetaygun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

demistfy_correspondence's Issues

Issues for Stanford_Dogs_Dataset

Hi, I downloaded the StanfordDog dataset but couldn't find the random_pairs.txt" or class_pairs.txt" files required in the code. Could you help me solve this problem?

Pre-Trained Model

Hi, I couldn't find your pre-trained model, only log files are provided, but loading log files can only load the last convolutional layer of the model.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.