{"id":18071880,"url":"https://github.com/innerlee/gcr","last_synced_at":"2025-04-12T02:53:28.130Z","repository":{"id":193970473,"uuid":"688766450","full_name":"innerlee/gcr","owner":"innerlee","description":"Official repository for ICCV 2023: Get the Best of Both Worlds: Improving Accuracy and Transferability by Grassmann Class","archived":false,"fork":false,"pushed_at":"2023-10-16T03:10:32.000Z","size":2151,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T22:36:35.118Z","etag":null,"topics":["classification","geometric-deep-learning","grassmann-manifold","iccv2023","transfer-learning"],"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/innerlee.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}},"created_at":"2023-09-08T04:09:02.000Z","updated_at":"2025-01-29T19:47:40.000Z","dependencies_parsed_at":"2023-09-26T10:17:41.066Z","dependency_job_id":null,"html_url":"https://github.com/innerlee/gcr","commit_stats":{"total_commits":9,"total_committers":4,"mean_commits":2.25,"dds":0.6666666666666667,"last_synced_commit":"9103829843e19f0338e4aa16bd389a0d8a831d3f"},"previous_names":["innerlee/gcr"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innerlee%2Fgcr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innerlee%2Fgcr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innerlee%2Fgcr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innerlee%2Fgcr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/innerlee","download_url":"https://codeload.github.com/innerlee/gcr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248509817,"owners_count":21116124,"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":["classification","geometric-deep-learning","grassmann-manifold","iccv2023","transfer-learning"],"created_at":"2024-10-31T09:17:36.449Z","updated_at":"2025-04-12T02:53:28.107Z","avatar_url":"https://github.com/innerlee.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Grassmann Class Representation\n\n[![🦢 - Paper](https://img.shields.io/badge/🦢-Paper-red)](https://arxiv.org/pdf/2308.01547)\n[![🌊 - Poster](https://img.shields.io/badge/🌊-Poster-blue)](./resource/gcr-iccv2023-poster.pdf)\n\nOfficial code for \"Get the Best of Both Worlds: Improving Accuracy and Transferability by Grassmann Class Representation (ICCV 2023)\"\n\nhttps://github.com/innerlee/gcr/assets/9464825/37708eb8-740c-46df-ad24-7bcf6ef592c9\n\n![Grassmann class representation](./resource/pipeline_gcr.jpg)\n\n## Installation\n\nRun\n\n```bash\npython setup.py develop\n```\n\n### Requirements\n\n- pytorch \u003e= 1.13\n- mmpretrain\n\n### Prepare data\n\nPut ImageNet1-K dataset on `data/imagenet` folder\n\n## ImageNet1-K Pretrained Weights\n\n| Architecture | Trick         | Class Representation | Dim | Top1      | Top5      | Config                                                                    | Log                                                                                          | Checkpoint                                                                                    |\n| ------------ | ------------- | -------------------- | --- | --------- | --------- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |\n| ResNet50-D   |               | Vector               | -   | 78.05     | 93.90     | [config](configs/resnet/resnet50d_8xb32_coslr_in1k.py)                    | [log](https://drive.google.com/file/d/19NMZs1dlCshW1_8PJx7s200xl_RzoV-j/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1Co5FJYqDcqeEYw_ORTOrRxg3oh2acfRI/view?usp=drive_link) |\n| ResNet50-D   |               | GCR                  | 1   | 78.42     | 94.14     | [config](configs/resnet/resnet50d_8xb32_coslr_in1k_gcr1.py)               | [log](https://drive.google.com/file/d/1e0sJRdtMZOEgM9AfENNsicHhtjMawgw7/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1m1F9TmOQjmKli-_U5ifSxVoiH8R0tHK1/view?usp=drive_link) |\n| ResNet50-D   |               | GCR                  | 4   | 78.68     | 94.32     | [config](configs/resnet/resnet50d_8xb32_coslr_in1k_gcr4.py)               | [log](https://drive.google.com/file/d/12v7UZWrlh3ClIJmz6ysGGMN5TTg50XRI/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1tIXkD9zB7y4Ni3RZYNKgQTZw_PCZkCJV/view?usp=drive_link) |\n| ResNet50-D   |               | GCR                  | 8   | 79.26     | 94.44     | [config](configs/resnet/resnet50d_8xb32_coslr_in1k_gcr8.py)               | [log](https://drive.google.com/file/d/18Hns24rv66163uPKiZZGnoEVal4An7Lc/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1FpuEpzqf-v3c8rsdFX882mKXLY07sXwc/view?usp=drive_link) |\n| ResNet50-D   |               | GCR                  | 16  | 79.21     | 94.37     | [config](configs/resnet/resnet50d_8xb32_coslr_in1k_gcr16.py)              | [log](https://drive.google.com/file/d/1kodUwqZuACdi259DBUVhYlGyMpA-FsVb/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1N9l7Lb-gSMOK-1JzUqa0wLgb81_iBCw1/view?usp=drive_link) |\n| ResNet50-D   |               | GCR                  | 32  | 78.63     | 94.05     | [config](configs/resnet/resnet50d_8xb32_coslr_in1k_gcr32.py)              | [log](https://drive.google.com/file/d/1O0SeintbVELA9_-hIcHIJx930TdlHQ9S/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1Rq2ugIMOZbpDufpiKpewKR4xc9DTExu7/view?usp=drive_link) |\n| ResNet50-D   | RSB-A1        | Vector               | -   | 80.53     | 94.98     | [config](configs/resnet/resnet50d_8xb256-rsb-a1-600e_in1k.py)             | [log](https://drive.google.com/file/d/1cNw6Kf_BbDn4M3dFfy2gANr3aZgUKEo_/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1ororxl3RMuYTB7TD83nb9Fyq5VuBI5Pq/view?usp=drive_link) |\n| ResNet50-D   | RSB-A1        | GCR                  | 8   | 81.00     | 95.40     | [config](configs/resnet/resnet50d_8xb256-rsb-a1-600e_in1k_gcr8.py)        | [log](https://drive.google.com/file/d/1SjpT47lTpUPnI33xM9SC3SpC0s440twP/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1njtbpwfz1duOilapCcUnTpGX2eTuTy_U/view?usp=drive_link) |\n| ResNet50-D   | RSB-A1 FixRes | GCR                  | 8   | **81.30** | **95.42** | [config](configs/resnet/resnet50d_8xb256-rsb-a1-600e_in1k_gcr8_fixres.py) | [log](https://drive.google.com/file/d/1QSXNiLUK-6VhrktW2hlkNcGS95AJ7RoZ/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/17hYOOMLrg8wOs6g1ehtfbQ_gMWsoYh9j/view?usp=drive_link) |\n| ResNet50-D   | RSB-A2        | Vector               | -   | 80.29     | 94.86     | [config](configs/resnet/resnet50d_8xb256-rsb-a2-300e_in1k.py)             | [log](https://drive.google.com/file/d/1qaVXUYU7SYhuk5ZeRAblGpVC38XvSv8M/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1LOVRzzP3BfhRvdDgSUgTJ3So9NxllX3N/view?usp=drive_link) |\n| ResNet50-D   | RSB-A2        | GCR                  | 8   | 80.75     | 95.24     | [config](configs/resnet/resnet50d_8xb256-rsb-a2-300e_in1k_gcr8.py)        | [log](https://drive.google.com/file/d/14BXtMZIM1SEJLdQzRveloE0nRIMcuxH6/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1Vm5xqOXzRXTK_4URXW8rbeevOHXgUOBP/view?usp=drive_link) |\n| ResNet50-D   | RSB-A2 FixRes | GCR                  | 8   | 81.04     | 95.46     | [config](configs/resnet/resnet50d_8xb256-rsb-a2-300e_in1k_gcr8_fixres.py) | [log](https://drive.google.com/file/d/17Wyg0r5_a8ENpoPMQOdtXUxUxPoc6P9L/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1RRHAGOd14B7wQb5tcR5blxcm5EBk4wqw/view?usp=drive_link) |\n| ResNet50-D   | RSB-A3        | Vector               | -   | 79.36     | 94.47     | [config](configs/resnet/resnet50d_8xb256-rsb-a3-100e_in1k.py)             | [log](https://drive.google.com/file/d/1pRxmvOcExofZlhL3ajB99Y7CtQiaC8gD/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1SXSfGEE_OOBDqMYXOFJOmJsj5nTe8Mpy/view?usp=drive_link) |\n| ResNet50-D   | RSB-A3        | GCR                  | 8   | 79.64     | 94.85     | [config](configs/resnet/resnet50d_8xb256-rsb-a3-100e_in1k_gcr8.py)        | [log](https://drive.google.com/file/d/1x9BGutIOzdvZwvTxSwbu-e7GSWINDXCv/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1gD11fWCReLKU0hoqJzK-7oBZDjWA0S-U/view?usp=drive_link) |\n| ResNet50-D   | RSB-A3 FixRes | GCR                  | 8   | 80.20     | 95.15     | [config](configs/resnet/resnet50d_8xb256-rsb-a3-100e_in1k_gcr8_fixres.py) | [log](https://drive.google.com/file/d/1rNwRPSFz_-FLOJxTLnUPSOvSqtrAFBm0/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1ZDXr5V0KIUEk64LrdwTaAvayw7dXD-VL/view?usp=drive_link) |\n| ResNet101-D  |               | Vector               | -   | 79.31     | 94.67     | [config](configs/resnet/resnet101d_8xb32-coslr_in1k.py)                   | [log](https://drive.google.com/file/d/1f7si6980G9ni6mC8o2dU5n9yQ-yRtav3/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1RZNdlM00B1TWoOT3YpTD3_TZY0ZDjGdI/view?usp=drive_link) |\n| ResNet101-D  |               | GCR                  | 8   | 80.24     | 94.95     | [config](configs/resnet/resnet101d_8xb32-coslr_in1k_gcr8.py)              | [log](https://drive.google.com/file/d/1PMEOvvh5z602T7HdwfPQCafkVjeXMceJ/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1SS3iyVko63lA6G4OTlDVgVWGmzTV2njF/view?usp=drive_link) |\n| ResNet152-D  |               | Vector               | -   | 80.00     | 95.02     | [config](configs/resnet/resnet152d_8xb32-coslr_in1k.py)                   | [log](https://drive.google.com/file/d/1FWxJyDcEpnoRStN16n2GyIevEJ-hHkS1/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1wRIL19r_c8o_2eXZE2ARtEGf77KxhiVn/view?usp=drive_link) |\n| ResNet152-D  |               | GCR                  | 8   | 80.44     | 95.21     | [config](configs/resnet/resnet152d_8xb32-coslr_in1k_gcr8.py)              | [log](https://drive.google.com/file/d/1e4UO1jtTViv7zww6wnR__hinpNSjPx0R/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1yFiJ9lqy9uD1HQ02MWzw_ZlXLiqjK4BY/view?usp=drive_link) |\n| VGG13-BN     |               | Vector               | -   | 72.02     | 90.79     | [config](configs/vgg/vgg13bn_8xb32_in1k.py)                               | [log](https://drive.google.com/file/d/1SsLzmDmiQGaDToIYWk-9f8tOp2Mscu3R/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1AP2fI7nFGRZ6mU__E8N-MV5ecEZ1KW4o/view?usp=drive_link) |\n| VGG13-BN     |               | GCR                  | 8   | 73.40     | 91.30     | [config](configs/vgg/vgg13bn_8xb32_in1k_gcr8.py)                          | [log](https://drive.google.com/file/d/1tt_iy_R2uSRXm2adPOsLC1uVbij4pEud/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/10EJP9eU-EoFxy11T_qOm8urUHj71BuFz/view?usp=drive_link) |\n| Swin-T       |               | Vector               | -   | 81.06     | 95.51     | [config](configs/swin_transformer/swin-tiny_8xb128_in1k.py)               | [log](https://drive.google.com/file/d/1USGKrheQe6jK1xkFPgUt8M1DFpGc8FNr/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1xstvE_t89F_SNc_zDm2OxRJ-Irq5SLYN/view?usp=drive_link) |\n| Swin-T       |               | GCR                  | 8   | 81.63     | 95.77     | [config](configs/swin_transformer/swin-tiny_8xb128_in1k_gcr8.py)          | [log](https://drive.google.com/file/d/1_mTgAMA95rkwMpzM0hjmM7qNN5V4CNFV/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1RIpMraINw6CjvUAzNiAJOm11xQq-SUSx/view?usp=drive_link) |\n| Deit3-S      |               | Vector               | -   | 81.53     | 95.22     | [config](configs/deit3/deit3-small-p16_8xb256_in1k-224px.py)              | [log](https://drive.google.com/file/d/11FEoYMfzTxOXeFAubz-BsnEhv7mCrXYW/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1WFPbxiOOu380qsYQeNFtRSwVJV4eZR12/view?usp=drive_link) |\n| Deit3-S      |               | GCR                  | 8   | 82.18     | 95.73     | [config](configs/deit3/deit3-small-p16_8xb256_in1k-224px_gcr8.py)         | [log](https://drive.google.com/file/d/1r-mJZ04DFcJwMfDij9fSR7eEh16cyZeK/view?usp=drive_link) | [ckpt](https://drive.google.com/file/d/1n-uHEWuiyJ1OLeuD555hfyJugKmXBYCx/view?usp=drive_link) |\n\n## Training\n\n```bash\n# train ResNet50d baseline with 8 gpus\n./tools/dist_train.sh configs/resnet/resnet50d_8xb32-coslr_in1k.py 8\n\n# train the gcr version\n./tools/dist_train.sh configs/resnet/resnet50d_8xb32-coslr_in1k_gcr8.py 8\n```\n\n## Citation\n\n```\n@inproceedings{haoqi2023gcr,\ntitle = {Get the Best of Both Worlds: Improving Accuracy and Transferability by Grassmann Class Representation},\nauthor = {Wang, Haoqi and Li, Zhizhong and Zhang, Wayne},\nbooktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},\nyear = {2023}\n}\n```\n\n\n## Related Projects\n\n[ViM: Out-Of-Distribution with Virtual-logit Matching (CVPR 2022)](https://github.com/haoqiwang/vim)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finnerlee%2Fgcr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finnerlee%2Fgcr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finnerlee%2Fgcr/lists"}