{"id":13422313,"url":"https://github.com/SHI-Labs/Self-Similarity-Grouping","last_synced_at":"2025-03-15T11:31:41.068Z","repository":{"id":118977221,"uuid":"200431310","full_name":"SHI-Labs/Self-Similarity-Grouping","owner":"SHI-Labs","description":"Self-similarity Grouping: A Simple Unsupervised Cross Domain Adaptation Approach for Person Re-identification (ICCV 2019, Oral)","archived":false,"fork":false,"pushed_at":"2020-05-09T04:12:08.000Z","size":1980,"stargazers_count":187,"open_issues_count":25,"forks_count":43,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-08-10T07:01:17.315Z","etag":null,"topics":["computer-vision","deep-learning","domain-adaptation","person-reidentification"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SHI-Labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-08-03T23:54:00.000Z","updated_at":"2024-08-10T07:01:17.315Z","dependencies_parsed_at":"2023-05-01T01:47:14.218Z","dependency_job_id":null,"html_url":"https://github.com/SHI-Labs/Self-Similarity-Grouping","commit_stats":null,"previous_names":["oasisyang/ssg"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SHI-Labs%2FSelf-Similarity-Grouping","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SHI-Labs%2FSelf-Similarity-Grouping/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SHI-Labs%2FSelf-Similarity-Grouping/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SHI-Labs%2FSelf-Similarity-Grouping/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SHI-Labs","download_url":"https://codeload.github.com/SHI-Labs/Self-Similarity-Grouping/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221572091,"owners_count":16845581,"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":["computer-vision","deep-learning","domain-adaptation","person-reidentification"],"created_at":"2024-07-30T23:00:41.468Z","updated_at":"2024-10-26T19:32:56.301Z","avatar_url":"https://github.com/SHI-Labs.png","language":"Python","funding_links":[],"categories":["One Shot Domain Adaptation for Person Re-Identification. ICCV 2019 Oral"],"sub_categories":["[few-shot 知乎](https://zhuanlan.zhihu.com/p/58298920)"],"readme":"# Self-similarity Grouping: A Simple Unsupervised Cross Domain Adaptation Approach for Person Re-identificatio(SSG)\nImplementation of the paper [Self-similarity Grouping: A Simple Unsupervised Cross Domain Adaptation Approach for Person Re-identification](https://arxiv.org/abs/1811.10144), ICCV 2019 (Oral)\n\n\nThe SSG approach proposed in the paper is simple yet effective and achieves the state-of-arts on three re-ID datasets: Market1501, DukdMTMC and MSMT17.\n\n![Illustration of the Self-similarity Grouping.](./figs/framework.png)\n\n\u003c!-- ## Setup\n\n1. Datasets (source dataset and target dataset).\n2. Pre-trained (on source dataset) model.\n\n## Requirements\n\n- PyTorch --\u003e\n\n## Running the experiments\n\n### Step 1: Train on source dataset\n\nRun `source_train.py` via\n\n```shell\npython source_train.py \\\n    --dataset \u003cname_of_source_dataset\u003e\\\n    --resume \u003cdir_of_source_trained_model\u003e\\\n    --data_dir \u003cdir_of_source_data\u003e\\\n    --logs_dir \u003cdir_to_save_source_trained_model\u003e\n```\n\nTo replicate the results in the paper, you can download pre-trained models on Market1501, DukeMTMC and MSMT17 from [GoogleDrive](https://drive.google.com/file/d/1Z94qbsjuAQ9sLeEzURPstQxa3gluZIPJ/view?usp=sharing). There maybe some bugs in source_train.py, please refer to [DomainAdaptiveReID](https://github.com/LcDog/DomainAdaptiveReID) to obtained the pretrained model or just use the pretrained model provided by us.\nAnd you can find all models after adaptation from [GoogleDrive](https://drive.google.com/file/d/1BUp1fbjKTZGjL8WGCx3yUp2GXD10EdxC/view?usp=sharing). Our models can be trained with __PyTorch 0.4.1__ or __PyTorch 1.0__.\n\n### Step 2: Run Self-similarity Grouping\n\n```shell\npython selftraining.py \\\n    --src_dataset \u003cname_of_source_dataset\u003e\\\n    --tgt_dataset \u003cname_of_target_dataset\u003e\\\n    --resume \u003cdir_of_source_trained_model\u003e\\\n    --iteration \u003cnumber of iteration\u003e\\\n    --data_dir \u003cdir_of_source_target_data\u003e\\\n    --logs_dir \u003cdir_to_save_model_after_adaptation\u003e\\\n    --gpu-devices \u003cgpu ids\u003e\\\n    --num-split \u003cnumber of split\u003e\n```\nOr just command\n```shell\n./run.sh\n```\n### Step 3: Run Clustering-guided Semi-Supervised Training\n```shell\npython semitraining.py \\\n    --src_dataset \u003cname_of_source_dataset\u003e\\\n    --tgt_dataset \u003cname_of_target_dataset\u003e\\\n    --resume \u003cdir_of_source_trained_model\u003e\\\n    --iteration \u003cnumber of iteration\u003e\\\n    --data_dir \u003cdir_of_source_target_data\u003e\\\n    --logs_dir \u003cdir_to_save_model_after_adaptation\u003e\\\n    --gpu-devices \u003cgpu ids\u003e\\\n    --num-split \u003cnumber of split\u003e\\\n    --sample \u003csample method\u003e\n```\n\n## Results\n\n### Step 1: After training on source dataset\n\n| Source Dataset | Rank-1 | mAP |\n| :--- | :---: | :---: |\n| DukeMTMC | 82.6 | 70.5 |\n| Market1501 | 92.5 | 80.8 |\n| MSMT17 | 73.6 | 48.6 |\n\n### Step 2: After adaptation\n\n\u003c!-- markdownlint-disable MD033 --\u003e\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth rowspan=\"2\"\u003eSRC --\u0026gt; TGT\u003c/th\u003e\n        \u003cth colspan=\"2\"\u003eBefore Adaptation\u003c/th\u003e\n        \u003cth colspan=\"2\"\u003eAdaptation by SSG\u003c/th\u003e\n        \u003cth colspan=\"2\"\u003eAdaptation by SSG++\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003eRank-1\u003c/td\u003e\n        \u003ctd\u003emAP\u003c/td\u003e\n        \u003ctd\u003eRank-1\u003c/td\u003e\n        \u003ctd\u003emAP\u003c/td\u003e\n        \u003ctd\u003eRank-1\u003c/td\u003e\n        \u003ctd\u003emAP\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003eMarket1501 --\u0026gt; DukeMTMC\u003c/td\u003e\u003ctd\u003e30.5\u003c/td\u003e\u003ctd\u003e16.1\u003c/td\u003e\u003ctd\u003e73.0\u003c/td\u003e\u003ctd\u003e53.4\u003c/td\u003e\u003ctd\u003e76.0\u003c/td\u003e\u003ctd\u003e60.3\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003eDukeMTMC --\u0026gt; Market1501\u003c/td\u003e\u003ctd\u003e54.6\u003c/td\u003e\u003ctd\u003e26.6\u003c/td\u003e\u003ctd\u003e80.0\u003c/td\u003e\u003ctd\u003e58.3\u003c/td\u003e\u003ctd\u003e86.2\u003c/td\u003e\u003ctd\u003e68.7\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003eMarket1501 --\u0026gt; MSMT17 \u003c/td\u003e\u003ctd\u003e8.6\u003c/td\u003e\u003ctd\u003e2.7\u003c/td\u003e\u003ctd\u003e31.6\u003c/td\u003e\u003ctd\u003e13.2\u003c/td\u003e\u003ctd\u003e37.6\u003c/td\u003e\u003ctd\u003e16.6\u003c/td\u003e\u003c/tr\u003e\n    \u003ctr\u003e\u003ctd\u003eDukeMTMC --\u0026gt; MSMT17 \u003c/td\u003e\u003ctd\u003e12.38\u003c/td\u003e\u003ctd\u003e3.82\u003c/td\u003e\u003ctd\u003e32.2\u003c/td\u003e\u003ctd\u003e13.3\u003c/td\u003e\u003ctd\u003e41.6\u003c/td\u003e\u003ctd\u003e18.3\u003c/td\u003e\u003c/tr\u003e\n\n\n\u003c/table\u003e\n\n## Issues\n* The pre-trained model is trained with Pytorch 0.4.1, there may be some  error when loading it by Pytorch with higher version. This [link](https://github.com/CSAILVision/places365/issues/25#issuecomment-333871990) should be helpful\n* The source_training.py codes may have some bugs, I suggest you directly using our pretrained baseline model. And I will fix the bugs soon.\n* To reproduce results listed in paper, I recommend to use two GPUs with batch size of 32. And in general, the experimental results may have be a little different from the results listed in paper (+/-1%).\n\n## Acknowledgement\n\nOur code is based on [open-reid](https://github.com/Cysu/open-reid) and [DomainAdaptiveReID](https://github.com/LcDog/DomainAdaptiveReID).\n\n## Citation\nIf you find the code helpful in your resarch or work, please cite the following paper.\n```\n@InProceedings{Fu_2019_ICCV,\nauthor = {Fu, Yang and Wei, Yunchao and Wang, Guanshuo and Zhou, Yuqian and Shi, Honghui and Huang, Thomas S.},\ntitle = {Self-Similarity Grouping: A Simple Unsupervised Cross Domain Adaptation Approach for Person Re-Identification},\nbooktitle = {The IEEE International Conference on Computer Vision (ICCV)},\nmonth = {October},\nyear = {2019}\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSHI-Labs%2FSelf-Similarity-Grouping","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSHI-Labs%2FSelf-Similarity-Grouping","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSHI-Labs%2FSelf-Similarity-Grouping/lists"}