• Stars
    star
    262
  • Rank 156,136 (Top 4 %)
  • Language
    Python
  • License
    GNU Lesser Genera...
  • Created over 5 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Source code for the paper "Divide and Conquer the Embedding Space for Metric Learning", CVPR 2019

Divide and Conquer the Embedding Space for Metric Learning

About

This repository contains the code for reproducing the results for Divide and Conquer the Embedding Space for Metric Learning (CVPR 2019) with the datasets In-Shop Clothes, Stanford Online Products and PKU VehicleID.

Paper: pdf
Supplementary: pdf

We also applied our method to the Humpback Whale Identification Challenge at Kaggle and finished at 10th place out of 2131.
Slides: link

method pipeline

Requirements

Usage

The following command will train the model with Margin loss on the In-Shop Clothes dataset for 200 epochs and a batch size of 80 while splitting the embedding layer with 8 clusters and finetuning the model from epoch 190 on. You can use this command to reproduce the results of the paper for the three datasets by changing simply --dataset=inshop to --dataset=sop (Stanford Online Products) or --dataset=vid (Vehicle-ID).

CUDA_VISIBLE_DEVICES=0 python experiment.py --dataset=inshop \
--dir=test --exp=0 --random-seed=0 --nb-clusters=8 --nb-epochs=200 \
--sz-batch=80 --backend=faiss-gpu  --embedding-lr=1e-5 --embedding-wd=1e-4 \
--backbone-lr=1e-5 --backbone-wd=1e-4 --finetune-epoch=190

The model can be trained without the proposed method by setting the number of clusters to 1 with --nb-clusters=1.
For faster clustering we run Faiss on GPU. If you installed Faiss without GPU support use flag --backend=faiss.

Expected Results

The model checkpoints and log files are saved in the selected log-directory. You can print a summary of the results with python browse_results <log path>.

You will get slightly higher results than what we have reported in the paper. For SOP, In-Shop and Vehicle-ID the R@1 results should be somewhat around 76.40, 87.36 and 91.54.

Related Repos

  • Collection of baselines for metric learning from @Confusezius [PyTorch]

License

You may find out more about the license here

Reference

If you use this code, please cite the following paper:

Artsiom Sanakoyeu, Vadim Tschernezki, Uta Büchler, Björn Ommer. "Divide and Conquer the Embedding Space for Metric Learning", CVPR 2019.

@InProceedings{dcesml,
  title={Divide and Conquer the Embedding Space for Metric Learning},
  author={Sanakoyeu, Artsiom and Tschernezki, Vadim and B\"uchler, Uta and Ommer, Bj\"orn},
  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
  year={2019},
}

More Repositories

1

stable-diffusion

A latent text-to-image diffusion model
Jupyter Notebook
67,358
star
2

latent-diffusion

High-Resolution Image Synthesis with Latent Diffusion Models
Jupyter Notebook
11,417
star
3

taming-transformers

Taming Transformers for High-Resolution Image Synthesis
Jupyter Notebook
5,679
star
4

adaptive-style-transfer

source code for the ECCV18 paper A Style-Aware Content Loss for Real-time HD Style Transfer
Python
710
star
5

vunet

A generative model conditioned on shape and appearance.
Python
492
star
6

geometry-free-view-synthesis

Is a geometric model required to synthesize novel views from a single image?
Python
373
star
7

depth-fm

DepthFM: Fast Monocular Depth Estimation with Flow Matching
Jupyter Notebook
282
star
8

net2net

Network-to-Network Translation with Conditional Invertible Neural Networks
Python
221
star
9

zigma

A PyTorch implementation of the paper "ZigMa: A DiT-Style Mamba-based Diffusion Model"
Python
188
star
10

image2video-synthesis-using-cINNs

Implementation of Stochastic Image-to-Video Synthesis using cINNs.
Python
183
star
11

brushstroke-parameterized-style-transfer

TensorFlow implementation of our CVPR 2021 Paper "Rethinking Style Transfer: From Pixels to Parameterized Brushstrokes".
Python
158
star
12

fm-boosting

FMBoost: Boosting Latent Diffusion with Flow Matching (ECCV 2024 Oral)
122
star
13

imagebart

ImageBART: Bidirectional Context with Multinomial Diffusion for Autoregressive Image Synthesis
Python
122
star
14

iin

A Disentangling Invertible Interpretation Network
Python
122
star
15

retrieval-augmented-diffusion-models

Official codebase for the Paper “Retrieval-Augmented Diffusion Models”
Jupyter Notebook
112
star
16

attribute-control

Fine-Grained Subject-Specific Attribute Expression Control in T2I Models
Jupyter Notebook
101
star
17

content-style-disentangled-ST

Content and Style Disentanglement for Artistic Style Transfer [ICCV19]
89
star
18

unsupervised-disentangling

Python
54
star
19

invariances

Making Sense of CNNs: Interpreting Deep Representations & Their Invariances with Invertible Neural Networks
Python
53
star
20

interactive-image2video-synthesis

Python
51
star
21

ipoke

iPOKE: Poking a Still Image for Controlled Stochastic Video Synthesis
Python
46
star
22

instant-lora-composition

31
star
23

unsupervised-part-segmentation

Code for GCPR 2020 Oral : "Unsupervised Part Discovery by Unsupervised Disentanglement"
Jupyter Notebook
30
star
24

behavior-driven-video-synthesis

Python
27
star
25

content-targeted-style-transfer

Content Transformation Block For Image Style Transfer [CVPR19]
24
star
26

robust-disentangling

Unsupervised Robust Disentangling of Latent Characteristics for Image Synthesis
Python
23
star
27

metric-learning-divide-and-conquer-improved

Source code for the paper "Improving Deep Metric Learning byDivide and Conquer"
Python
20
star
28

cuneiform-sign-detection-dataset

Dataset provided with the article "Deep learning for cuneiform sign detection with weak supervision using transliteration alignment". It comprises image references, transliterations and sign annotations of clay tablets from the Neo-Assyrian epoch.
Jupyter Notebook
11
star
29

visual-search

Visual search interface
10
star
30

magnify-posture-deviations

Unsupervised Magnification of Posture Deviations Across Subjects
9
star
31

cuneiform-sign-detection-code

Code for the article "Deep learning of cuneiform sign detection with weak supervision using transliteration alignment"
Jupyter Notebook
7
star
32

hbugen2018

Towards Learning a Realistic Rendering of Human Behavior
7
star
33

AutomaticBehaviorAnalysis_NatureComm

Source Code + Documentation of our Automatic Behavior Analysis Software
MATLAB
5
star
34

cuneiform-sign-detection-webapp

Code for demo web application of the article "Deep learning for cuneiform sign detection with weak supervision using transliteration alignment".
JavaScript
4
star
35

Characterizing_Generalization_in_DML

Python
3
star
36

network-fusion

1
star