Coder Social home page Coder Social logo

gca-hng's Introduction

GCA-HNG: Globally Correlation-Aware Hard Negative Generation

This repository serves as the official PyTorch implementation for the paper: Globally Correlation-Aware Hard Negative Generation.

It offers source code for replicating the experiments conducted on four benchmark datasets (CUB-200-2011, Cars196, SOP, and InShop) and releases the pretrained metric models.

Requirements

  • Python 3.8
  • PyTorch 1.8.1+cu111
  • torch_scatter 2.0.9
  • numpy
  • tqdm
  • tensorboardX
  • scikit-learn
  • scipy

Datasets

  1. Download four benchmark datasets.
  2. Extract the tgz or zip file into ./data/dataset_name/original/ folder and run the data convert scripts to transform data format. In particular, the InShop dataset does not require any data transformation.
python scripts/data_process/xxx_convert.py
  1. The data folder is constructed as followed:
data:
├──  CUB200/CARS196/SOP
│  └──  class 
│    ├──  train 
│    │  ├──  Catrgory 1
│    │  ├──  Catrgory ...
│    │  └──  Catrgory M
│    └──  test
│       ├──  Catrgory 1
│       ├──  Catrgory ...
│       └──  Catrgory N
└──  IN_SHOP
   ├── img  
   │  ├──  MEN
   │  └──  WOMEN
   └──  list_eval_partition.txt

Training Process

Run the training process by designating the corresponding yml file.

python train.py --cfg scripts/cfgs/xxx.yml

Image Retrieval Evaluation

The released metric model is available at Google Drive.

Given the (full model/ metric model) with pretrained weights, run the evaluation process as follows:

python eval.py --cfg scripts/cfgs/xxx.yml --model_path xxx.pth

gca-hng's People

Contributors

pwenjay avatar

Stargazers

 avatar  avatar Gang Dai avatar Zhihao Xu avatar  avatar

Watchers

 avatar

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.