Giter VIP home page Giter VIP logo

pytorch-histogram-loss's Introduction

Histogram Loss

This is implementation of the paper Learning Deep Embeddings with Histogram Loss in PyTorch

Implementation details

Pretrained resnet 34 is used. Shared dropout and fully connected layer with 512 neurons are added to the end of the net.

Features should be l2 normalized before feeding to histogram loss.

Market-1501 Dataset is used for training and testing.

Loss, rank 1 and mAP metrics are visualized using visdom tools.

Quality

rank-1: 77.02

mAP: 54.71

Usage

main.py [-h] 
	--dataroot DATAROOT 
	[--batch_size BATCH_SIZE]
	[--batch_size_test BATCH_SIZE_TEST]
	[--checkpoints_path CHECKPOINTS_PATH] 
	[--cuda]
	[--dropout_prob DROPOUT_PROB] 
	[--lr LR] 
	[--lr_fc LR_FC]
	[--manual_seed MANUAL_SEED] 
	[--market] 
	[--nbins NBINS]
	[--nepoch NEPOCH] 
	[--nepoch_fc NEPOCH_FC] 
	[--nworkers NWORKERS]
	[--visdom_port VISDOM_PORT]


required argument:
  --dataroot DATAROOT   path to dataset
  
optional arguments:
  -h, --help            show this help message and exit
  --batch_size BATCH_SIZE
                        batch size for train, default=128
  --batch_size_test BATCH_SIZE_TEST
                        batch size for test and query dataloaders for market
                        dataset, default=64
  --checkpoints_path CHECKPOINTS_PATH
                        folder to output model checkpoints, default="."
  --cuda                enables cuda
  --dropout_prob DROPOUT_PROB
                        probability of dropout, default=0.7
  --lr LR               learning rate, default=1e-4
  --lr_fc LR_FC         learning rate to train fc layer, default=1e-1
  --manual_seed MANUAL_SEED
                        manual seed
  --market              calculate rank1 and mAP on Market dataset; dataroot
                        should contain folders "bounding_box_train",
                        "bounding_box_test", "query"
  --nbins NBINS         number of bins in histograms, default=150
  --nepoch NEPOCH       number of epochs to train, default=150
  --nepoch_fc NEPOCH_FC
                        number of epochs to train fc layer, default=0
  --nworkers NWORKERS   number of data loading workers, default=10
  --visdom_port VISDOM_PORT
                        port for visdom visualization

$ #start visdom server if use visdom_port argument
$ python -m visdom.server -port 8099
$ python main.py --dataroot ../data/Market-1501-v15.09.15 --cuda --checkpoints_path histogram --manual_seed 18 --visdom_port 8099 --nepoch_fc 0 --market --dropout_prob 0

pytorch-histogram-loss's People

Contributors

valerystrizh avatar

Watchers

James Cloos avatar Xiaoyu Chen avatar paper2code - bot 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.