All Projects → layumi → Person Reid Triplet Loss

layumi / Person Reid Triplet Loss

Person re-ID baseline with triplet loss

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Person Reid Triplet Loss

Computer Vision Leaderboard
Comparison of famous convolutional neural network models
Stars: ✭ 299 (+81.21%)
Mutual labels:  cnn, image-retrieval
Cnnimageretrieval
CNN Image Retrieval in MatConvNet: Training and evaluating CNNs for Image Retrieval in MatConvNet
Stars: ✭ 168 (+1.82%)
Mutual labels:  cnn, image-retrieval
Mxnet Ir
Image Retrieval Experiment Using Triplet Loss
Stars: ✭ 27 (-83.64%)
Mutual labels:  cnn, image-retrieval
Cnn Cbir Benchmark
CNN CBIR benchmark (ongoing)
Stars: ✭ 171 (+3.64%)
Mutual labels:  cnn, image-retrieval
Cnn For Image Retrieval
🌅The code of post "Image retrieval using MatconvNet and pre-trained imageNet"
Stars: ✭ 597 (+261.82%)
Mutual labels:  cnn, image-retrieval
Cnnimageretrieval Pytorch
CNN Image Retrieval in PyTorch: Training and evaluating CNNs for Image Retrieval in PyTorch
Stars: ✭ 931 (+464.24%)
Mutual labels:  cnn, image-retrieval
Mirror
Matchable Image Retrieval by Learning from Surface Reconstruction
Stars: ✭ 44 (-73.33%)
Mutual labels:  cnn, image-retrieval
Visualizing cnns
Using Keras and cats to visualize layers from CNNs
Stars: ✭ 143 (-13.33%)
Mutual labels:  cnn
Tensorflow template application
TensorFlow template application for deep learning
Stars: ✭ 1,851 (+1021.82%)
Mutual labels:  cnn
Self Driving Car 3d Simulator With Cnn
Implementing a self driving car using a 3D Driving Simulator. CNN will be used for training
Stars: ✭ 143 (-13.33%)
Mutual labels:  cnn
Liresolr
Putting LIRE into Solr - an ongoing project
Stars: ✭ 140 (-15.15%)
Mutual labels:  image-retrieval
Text Classification Demos
Neural models for Text Classification in Tensorflow, such as cnn, dpcnn, fasttext, bert ...
Stars: ✭ 144 (-12.73%)
Mutual labels:  cnn
Simple cnn
Simple Convolutional Neural Network Library
Stars: ✭ 158 (-4.24%)
Mutual labels:  cnn
Livianet
This repository contains the code of LiviaNET, a 3D fully convolutional neural network that was employed in our work: "3D fully convolutional networks for subcortical segmentation in MRI: A large-scale study"
Stars: ✭ 143 (-13.33%)
Mutual labels:  cnn
Tf Adnet Tracking
Deep Object Tracking Implementation in Tensorflow for 'Action-Decision Networks for Visual Tracking with Deep Reinforcement Learning(CVPR 2017)'
Stars: ✭ 162 (-1.82%)
Mutual labels:  cnn
Brdnet
Image denoising using deep CNN with batch renormalization(Neural Networks,2020)
Stars: ✭ 141 (-14.55%)
Mutual labels:  cnn
Mstar deeplearning project
Radar target classification, detection and recognition using deeplearning methods on MSTAR dataset
Stars: ✭ 163 (-1.21%)
Mutual labels:  cnn
Anime Face Gan Keras
A DCGAN to generate anime faces using custom mined dataset
Stars: ✭ 161 (-2.42%)
Mutual labels:  cnn
Awesome Speech Recognition Speech Synthesis Papers
Automatic Speech Recognition (ASR), Speaker Verification, Speech Synthesis, Text-to-Speech (TTS), Language Modelling, Singing Voice Synthesis (SVS), Voice Conversion (VC)
Stars: ✭ 2,085 (+1163.64%)
Mutual labels:  cnn
Pytorch deephash
Pytorch implementation of Deep Learning of Binary Hash Codes for Fast Image Retrieval, CVPRW 2015
Stars: ✭ 148 (-10.3%)
Mutual labels:  image-retrieval

Person_reID_triplet-loss-baseline

Baseline Code (with bottleneck) for Person-reID (pytorch).

We arrived [email protected]=86.45%, mAP=70.66% with ResNet stride=2. SGD optimizer is used.

Any suggestion is welcomed.

Model Structure

You may learn more from model.py. We use the L2-norm 2048-dim feature as the input.

Tips

  • News: I added the fp16 support.
  • I did not optimize the code. I strongly suggest use fp16 and use with torch.no_grad(). I will update the code later.
  • Larger margin may lead to a worse local minimum. (margin = 0.1-0.3 may provide a better result.)
  • Per-class sampler (Satisfied sampler)is not neccessary.
  • Adam optimizer is not neccessary.

Prerequisites

  • Python 3.6
  • GPU Memory >= 6G
  • Numpy
  • Pytorch 0.3+

(Some reports found that updating numpy can arrive the right accuracy. If you only get 50~80 Top1 Accuracy, just try it.) We have successfully run the code based on numpy 1.12.1 and 1.13.1 .

Getting started

Installation

git clone https://github.com/pytorch/vision
cd vision
python setup.py install

Because pytorch and torchvision are ongoing projects.

Here we noted that our code is tested based on Pytorch 0.3.0/0.4.0 and Torchvision 0.2.0.

Dataset & Preparation

Download Market1501 Dataset

Preparation: Put the images with the same id in one folder. You may use

python prepare.py

Remember to change the dataset path to your own path.

Futhermore, you also can test our code on DukeMTMC-reID Dataset. Our baseline code is not such high on DukeMTMC-reID [email protected]=64.23%, mAP=43.92%. Hyperparameters are need to be tuned.

To save trained model, we make a dir.

mkdir model 

Train

Train a model by

python train_new.py --gpu_ids 0 --name ft_ResNet50 --train_all --batchsize 32  --data_dir your_data_path

--gpu_ids which gpu to run.

--name the name of model.

--data_dir the path of the training data.

--train_all using all images to train.

--batchsize batch size.

--erasing_p random erasing probability.

Train a model with random erasing by

python train_new.py --gpu_ids 0 --name ft_ResNet50 --train_all --batchsize 32  --data_dir your_data_path --erasing_p 0.5

Test

Use trained model to extract feature by

python test.py --gpu_ids 0 --name ft_ResNet50 --test_dir your_data_path  --which_epoch 59

--gpu_ids which gpu to run.

--name the dir name of trained model.

--which_epoch select the i-th model.

--data_dir the path of the testing data.

Evaluation

python evaluate.py

It will output [email protected], [email protected], [email protected] and mAP results. You may also try evaluate_gpu.py to conduct a faster evaluation with GPU.

For mAP calculation, you also can refer to the C++ code for Oxford Building. We use the triangle mAP calculation (consistent with the Market1501 original code).

Related Repos

  1. Pedestrian Alignment Network
  2. 2stream Person re-ID
  3. Pedestrian GAN
  4. Language Person Search
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].