{"id":13626877,"url":"https://github.com/layumi/2016_person_re-ID","last_synced_at":"2025-04-16T19:31:03.564Z","repository":{"id":93935656,"uuid":"78332110","full_name":"layumi/2016_person_re-ID","owner":"layumi","description":"TOMM2017 A Discriminatively Learned CNN Embedding for Person Re-identification","archived":false,"fork":false,"pushed_at":"2023-12-03T06:14:17.000Z","size":14004,"stargazers_count":264,"open_issues_count":8,"forks_count":116,"subscribers_count":26,"default_branch":"master","last_synced_at":"2025-04-06T04:12:52.696Z","etag":null,"topics":["matconvnet","matlab","person-reidentification","re-id","reidentification","tomm2017"],"latest_commit_sha":null,"homepage":"https://dl.acm.org/citation.cfm?id=3159171","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/layumi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-01-08T08:59:26.000Z","updated_at":"2024-10-25T03:48:33.000Z","dependencies_parsed_at":"2024-02-04T13:17:11.025Z","dependency_job_id":null,"html_url":"https://github.com/layumi/2016_person_re-ID","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/layumi%2F2016_person_re-ID","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/layumi%2F2016_person_re-ID/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/layumi%2F2016_person_re-ID/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/layumi%2F2016_person_re-ID/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/layumi","download_url":"https://codeload.github.com/layumi/2016_person_re-ID/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249268547,"owners_count":21240940,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["matconvnet","matlab","person-reidentification","re-id","reidentification","tomm2017"],"created_at":"2024-08-01T22:00:24.114Z","updated_at":"2025-04-16T19:30:58.553Z","avatar_url":"https://github.com/layumi.png","language":"C","funding_links":[],"categories":["Uncategorized","Codes"],"sub_categories":["Uncategorized"],"readme":"## A Discriminatively Learned CNN Embedding for Person Re-identification\n\n![](https://github.com/layumi/2016_person_re-ID/blob/master/paper.jpg)\n\nIn this package, we provide our training and testing code written in [Matconvnet](http://www.vlfeat.org/matconvnet/) for the paper [A Discriminatively Learned CNN Embedding for Person Re-identification](https://arxiv.org/abs/1611.05666).\n \nWe also include matconvnet-beta23 which has been modified for our paper. All codes have been test on Ubuntu14.04 and Ubuntu16.04 with Matlab R2015b.\n\n**This code is ONLY released for academic use.**\n\n## Resources\n\n* [Weihang Chen](https://github.com/ahangchen) also realizes our paper in [Keras](https://github.com/ahangchen/rank-reid/tree/release). ([![GitHub stars](https://img.shields.io/github/stars/ahangchen/rank-reid.svg?style=flat\u0026label=Star)](https://github.com/ahangchen/rank-reid/tree/release))\n* [Xuanyi Dong](https://github.com/D-X-Y) also realizes our paper in [Caffe](https://github.com/D-X-Y/caffe-reid). ([![GitHub stars](https://img.shields.io/github/stars/D-X-Y/caffe-reid.svg?style=flat\u0026label=Star)](https://github.com/D-X-Y/caffe-reid))\n* [Zhun Zhong](https://github.com/zhunzhong07/IDE-baseline-Market-1501) provides a extensive [Caffe baseline code](https://github.com/zhunzhong07/IDE-baseline-Market-1501). You may check it. ([![GitHub stars](https://img.shields.io/github/stars/zhunzhong07/IDE-baseline-Market-1501.svg?style=flat\u0026label=Star)](https://github.com/zhunzhong07/IDE-baseline-Market-1501))\n* [Zhedong Zheng](https://github.com/layumi) provides a [strong Pytorch baseline](https://github.com/layumi/Person_reID_baseline_pytorch) ([![GitHub stars](https://img.shields.io/github/stars/layumi/Person_reID_baseline_pytorch.svg?style=flat\u0026label=Star)](https://github.com/layumi/Person_reID_baseline_pytorch)) and realizes our paper in [Pytorch](https://github.com/layumi/Person-reID-verification). ([![GitHub stars](https://img.shields.io/github/stars/layumi/Person-reID-verification.svg?style=flat\u0026label=Star)](https://github.com/layumi/Person-reID-verification))\n\n~What's new: We add the data preparation and evaluation codes for CUHK03.\n\n~What's new: We make the code of model structure more easy to follow.\n\n~What's new: We provide a better code for extract feature.\n\n~What's new: We provide a faster evaluation code for Market-1501.\n\n## Installation\n1. Clone this repo\n \n\t```Shell\n\tgit clone https://github.com/layumi/2016_person_re-ID.git\n\tcd 2016_person_re-ID\n\tmkdir data\n\t```\n\n2. Download the pretrained model. \n\t\n\t**This model is ONLY released for academic use.**\n\tYou can find the pretrained model in [GoogleDriver](https://drive.google.com/open?id=0B0VOCNYh8HeRWks0V24xTlpKWkU) or [BaiduYun] (https://pan.baidu.com/s/1miG2OpM). Download and put them into the `./data`.\n\n\tBaiduYun sometime changes the link. If you find the url fail, you can contact me to update it.\n\t\n3. Compile matconvnet \n**(Note that I have included my Matconvnet in this repo, so you do not need to download it again. I has changed some codes comparing with the original version. For example, one of the difference is in `/matlab/+dagnn/@DagNN/initParams.m`. If one layer has params, I will not initialize it again, especially for pretrained model.)**\n\n\tYou just need to uncomment and modify some lines in `gpu_compile.m` and run it in Matlab. Try it~\n\t(The code does not support cudnn 6.0. You may just turn off the Enablecudnn or try cudnn5.1)\n\n\tIf you fail in compilation, you may refer to http://www.vlfeat.org/matconvnet/install/\n\n## Dataset\n* Download [Market1501 Dataset](http://www.liangzheng.org/Project/project_reid.html). [[Google]](https://drive.google.com/file/d/0B8-rUzbwVRk0c054eEozWG9COHM/view) [[Baidu]](https://pan.baidu.com/s/1ntIi2Op) The photos are taken in Tsinghua University.\n\n* DukeMTMC-reID is a larger dataset in the same format of Market1501. The photos are taken in Duke University.\nYou can download it from [DukeMTMC-reID Dataset](https://github.com/layumi/DukeMTMC-reID_evaluation). We also upload the result to DukeMTMC-reID leaderboard.\n\n* If you want to rehearsal our result on [CUHK03 Dataset](http://www.ee.cuhk.edu.hk/~rzhao/), you can simply change the number of kernel from 751 to 1367 in `resnet52_market.m` and recreate `net.mat`. Because there are 751 IDs in Market-1501 while 1367 training identities are in CUHK03. More information can be found in `cuhk03-prepare-eval` dir. We add the data preparation and evaluation codes for CUHK03.\n\n* Training dataset for Oxford5k (http://cmp.felk.cvut.cz/cnnimageretrieval/)\n\n## Test \n1. Run `test/test_gallery_query_crazy.m` to extract the features of images in the gallery and query set. They will store in a .mat file. Then you can use it to do evaluation.\n2. Evaluate feature on the Market-1501. Run `evaluation/zzd_evaluation_res_faster.m`. You can get the following Single-query Result.\n\n| Methods               | Rank@1 | mAP    | \n| --------              | -----  | ----   | \n| Ours* (SQ)            | 80.82% | 62.30% | \n| Ours* (MQ-avg)        | 86.67% | 70.16% | \n| Ours* (MQ-max)        | 86.76% | 70.68% | \n| Ours* (MQ-max+rerank) | 86.67% | 72.55% | \n\n*Note that the result is slightly higher than the result reported in our paper.\n\n*For multi-query result, you can use `evaluation/zzd_evaluation_res_fast.m` . It is slower than `evaluation/zzd_evaluation_res_faster.m`  since it need to extract extra features. (The evaluation code is modified from the [Market-1501 Baseline Code](http://www.liangzheng.org/Project/project_reid.html))\n\n## FQA\n1. What is multi-query setting?\n\nActually, we can get a sequence of the query under one camera instead of one image. Then we can use every image in this sequence to extract a query mean feature (mean of feature extracted from several images).\nWe call it multi-query. If we use this feature to do person retrieval, we usually get a better result.\nBut it use additional images (in 'Market-1501/gt_bboxes'). You can find more detail in the [original paper](http://www.cv-foundation.org/openaccess/content_iccv_2015/papers/Zheng_Scalable_Person_Re-Identification_ICCV_2015_paper.pdf). \n\n## Train\n1. Add your dataset path into `prepare_data.m` and run it. Make sure the code outputs the right image path.\n\n2. Run `train_id_net_res_2stream.m` to have fun.\n\n## Citation\nPlease cite this paper in your publications if it helps your research:\n```bibtex\n@article{zheng2016discriminatively,\n  title={A Discriminatively Learned CNN Embedding for Person Re-identification},\n  author={Zheng, Zhedong and Zheng, Liang and Yang, Yi},\n  doi={10.1145/3159171},\n  note={\\mbox{doi}:\\url{10.1145/3159171}},\n  journal={ACM Transactions on Multimedia Computing Communications and Applications},\n  year={2017}\n}\n```\n## Acknowledge\nThanks for Xuanyi Dong to realize our paper in Caffe.\n\nThanks for Weihang Chen to realize our paper in Keras.\n\nThanks for Weihang Chen to report the bug in `prepare_data.m`.\n\n## Related Repos\n1. [Person re-ID with GAN](https://github.com/layumi/Person-reID_GAN)\n2. [Pedestrian Alignment Network](https://github.com/layumi/Pedestrian_Alignment)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flayumi%2F2016_person_re-ID","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flayumi%2F2016_person_re-ID","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flayumi%2F2016_person_re-ID/lists"}