Awesome
CCSC
Cross-Compatible Embedding and Semantic Consistent Feature Construction for Sketch Re-identification
Usage
-
This project is based on TransReID[1] (paper and official code)
-
Usage of this code is free for research purposes only.
Installation
pip install -r requirements.txt
we use /torch 1.7 /timm 0.3.2 for training and evaluation.
Prepare Datasets
Preparing the dataset(Sketch Re-ID dataset[2] (paper) and QMUL-Shoe-v2[3] (paper)). and QMUL-Chair-v2[3] (paper)).
Prepare Transformer Pre-trained Models
You need to download the ImageNet pretrained transformer model : pre-train
Train
- We utilize 1 GPU for training.
- train, please replace dataset-path with your own path
- To begin training.(See the code and our paper for more details)
# Sketch Re-ID dataset
python train.py --config_file /configs/transformerPKU.yml
# QMUL-Shoe-v2
python train.py --config_file /configs/transformer_ShoeV2.yml
# QMUL-Chair-v2
python train.py --config_file /configs/transformer_ChairV2.yml
Test
- Downloading the parameter files trained in this paper.( Using to verify the effectiveness of the proposed method).Sketch Re-ID, QMUL-Shoe-v2, QMUL-Chair-v2.
- To begin testing.(See the code for more details)
# Sketch Re-ID dataset
python test.py --config_file /configs/transformerPKU.yml TEST.WEIGHT 'PKU_logs/transformer_100.pth'
# QMUL-Shoe-v2
python test.py --config_file /configs/transformer_ShoeV2.yml TEST.WEIGHT 'shoe_logs/transformer_100.pth'
# QMUL-Chair-v2
python test.py --config_file /configs/transformer_ChairV2.yml TEST.WEIGHT 'chair_logs/transformer_100.pth'
Contact
If you have any question, please feel free to contact me. E-mail: wangyongzeng@stu.kust.edu.cn,shuangli936@gmail.com
Reference
[1]He S, Luo H, Wang P, et al. Transreid: Transformer-based object re-identification[C]//Proceedings of the IEEE/CVF international conference on computer vision. 2021: 15013-15022.
[2]Pang L, Wang Y, Song Y Z, et al. Cross-domain adversarial feature learning for sketch re-identification[C]//Proceedings of the 26th ACM international conference on Multimedia. 2018: 609-617.
[3]Yu Q, Song J, Song Y Z, et al. Fine-grained instance-level sketch-based image retrieval[J]. International Journal of Computer Vision, 2021, 129(2): 484-500.