README.md

July 2, 2026 · View on GitHub

A Theory-Inspired Framework for Few-Shot Cross-Modal Sketch Person Re-Identification

Yunpeng Gong1, Yongjie Hou2, Jiangming Shi3, Kim Long Diep1, Min Jiang1,*

1. School of Informatics, Xiamen University  
2. School of Electronic Science and Engineering, Xiamen University  
3. Institute of Artificial Intelligence, Xiamen University

teaser

Dataset

Download MaSk1K dataset (Short for Market-Sketch-1K), Market1501 dataset, and Market1501 attributes. Put MaSk1K and Market1501 separately into your <data_path>.

Guidence

Requirements

download the necessary dependencies using cmd.

pip install -r requirements.txt

Preprocess

python preprocess.py \
  --data_path=<data_path> \
  --train_style <train_style> \
  [--train_mq]
  • <data_path> should be replaced with the path to your data.
  • <train_style> refers to the styles you want to include in your training set. You can use any combination of styles A-F, such as B, AC, CEF, and so on.
  • [--train_mq] argument is optional and can be used to enable multi-query during training.

Start training

python train.py \
  --meta_train_data_path=<market1501_dataset_path> \
  --meta_test_data_path=<mask1k_dataset_path> \
  --train_style <train_style> \
  --test_style <test_style> \
  [--train_mq] \
  [--test_mq]
  • <market1501_dataset_path> and <mask1k_dataset_path> should be path of the datasets.
  • <train_style> and <test_style> should be replaced with the styles you want to use for your training and testing sets, respectively. Just like in the preprocessing step, you can use any combination of styles A-F.
  • [--train_mq] argument is used for enabling multi-query during training, and [--test_mq] serves a similar purpose during testing.

Evaluation

python test.py \
  --train_style <train_style> \
  --test_style <test_style> \
  --resume <model_filename> \
  [--test-mq]
  • <train_style> should be replaced with the styles you used for your training.
  • <test_style> should be replaced with the styles you want to use for your testing.
  • <model_filename> should be the filename of your trained model.
  • [--test_mq] argument is used for enabling multi-query during testing.

Visualization

python test_topk.py 
teaser

Acknowledgements

Our code is based on ssreid (subjectivity-sketch-reid) and provides a comparison with ssreid using CLIP.

Citation

If you find our work helpful, please consider citing our work using the following bibtex.

@inproceedings{gong2026,
  title={A Theory-Inspired Framework for Few-Shot Cross-Modal Sketch Person Re-Identification},
  author={Yunpeng Gong, Yongjie Hou, Jiangming Shi, Kim Long Diep, Min Jiang},
  booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
  year={2026},
}
@inproceedings{colorAttack2022,
  title={Person re-identification method based on color attack and joint defence},
  author={Gong, Yunpeng and Huang, Liqing and Chen, Lifei},
  booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  pages={4313--4322},
  year={2022}
}
@article{gong2024cross,
	title={Cross-modality perturbation synergy attack for person re-identification},
	author={Gong, Yunpeng and Zhong, Zhun and Qu, Yansong and Luo, Zhiming and Ji, Rongrong and Jiang, Min},
	journal={Advances in Neural Information Processing Systems},
	volume={37},
	pages={23352--23377},
	year={2024}
}

Contact Me

Email: 1286670508@qq.com