{"id":16270209,"url":"https://github.com/shoufachen/cyclemlp","last_synced_at":"2025-04-10T02:24:58.968Z","repository":{"id":37378930,"uuid":"388140010","full_name":"ShoufaChen/CycleMLP","owner":"ShoufaChen","description":"[ICLR'22 Oral] Implementation of \"CycleMLP: A MLP-like Architecture for Dense Prediction\"","archived":false,"fork":false,"pushed_at":"2022-04-25T10:36:03.000Z","size":567,"stargazers_count":286,"open_issues_count":4,"forks_count":27,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-03T00:05:32.822Z","etag":null,"topics":["backbone-models","mlp","pytorch"],"latest_commit_sha":null,"homepage":"","language":"Python","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/ShoufaChen.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}},"created_at":"2021-07-21T14:16:51.000Z","updated_at":"2025-03-27T10:17:53.000Z","dependencies_parsed_at":"2022-08-26T01:11:30.497Z","dependency_job_id":null,"html_url":"https://github.com/ShoufaChen/CycleMLP","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShoufaChen%2FCycleMLP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShoufaChen%2FCycleMLP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShoufaChen%2FCycleMLP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ShoufaChen%2FCycleMLP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ShoufaChen","download_url":"https://codeload.github.com/ShoufaChen/CycleMLP/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248143572,"owners_count":21054799,"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":["backbone-models","mlp","pytorch"],"created_at":"2024-10-10T18:09:52.591Z","updated_at":"2025-04-10T02:24:58.945Z","avatar_url":"https://github.com/ShoufaChen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## CycleMLP: A MLP-like Architecture for Dense Prediction (ICLR 2022 Oral)\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n![Python 3.8](https://img.shields.io/badge/python-3.8-green.svg)\n\n\n\n\u003cp align=\"middle\"\u003e\n  \u003cimg src=\"figures/teaser.png\" height=\"300\" /\u003e\n  \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\n  \u003cimg src=\"figures/flops.png\" height=\"300\" /\u003e\n\u003c/p\u003e\n\nThis is a PyTorch implementation of the paper [CycleMLP: A MLP-like Architecture for Dense Prediction](https://arxiv.org/abs/2107.10224).\n\n## Updates\n\n- (29/01/2022) CycleMLP is accepted by ICLR 2022 as an **oral presentation**.:fire::fire::fire:\n- (22/07/2021) Initial release.\n\n\n\n## Model Zoo\n\nWe provide CycleMLP models pretrained on ImageNet 2012.\n\n| Model                | Parameters | FLOPs    | Top 1 Acc. | Download |\n| :------------------- | :--------- | :------- | :--------- | :------- |\n| CycleMLP-B1          | 15M        |  2.1G    |  78.9%     |[model](https://github.com/ShoufaChen/CycleMLP/releases/download/v0.1/CycleMLP_B1.pth)|\n| CycleMLP-B2          | 27M        |  3.9G    |  81.6%     |[model](https://github.com/ShoufaChen/CycleMLP/releases/download/v0.1/CycleMLP_B2.pth)|\n| CycleMLP-B3          | 38M        |  6.9G    |  82.4%     |[model](https://github.com/ShoufaChen/CycleMLP/releases/download/v0.1/CycleMLP_B3.pth)|\n| CycleMLP-B4          | 52M        |  10.1G   |  83.0%     |[model](https://github.com/ShoufaChen/CycleMLP/releases/download/v0.1/CycleMLP_B4.pth)|\n| CycleMLP-B5          | 76M        |  12.3G   |  83.2%     |[model](https://github.com/ShoufaChen/CycleMLP/releases/download/v0.1/CycleMLP_B5.pth)|\n| CycleMLP-T           | 28M        |  4.4G    |  81.3%     |[model](https://github.com/ShoufaChen/CycleMLP/releases/download/v0.1/CycleMLP_tiny.pth)|\n| CycleMLP-S           | 50M        |  8.5G    |  82.9%     |[model](https://github.com/ShoufaChen/CycleMLP/releases/download/v0.1/CycleMLP_small.pth)|\n| CycleMLP-B           | 88M        |  15.2G   |  83.4%     |[model](https://github.com/ShoufaChen/CycleMLP/releases/download/v0.1/CycleMLP_base.pth)|\n\n## Usage\n\n\n### Install\n\n- PyTorch 1.7.0+ and torchvision 0.8.1+\n- [timm](https://github.com/rwightman/pytorch-image-models/tree/c2ba229d995c33aaaf20e00a5686b4dc857044be):\n```\npip install 'git+https://github.com/rwightman/pytorch-image-models@c2ba229d995c33aaaf20e00a5686b4dc857044be'\n\nor\n\ngit clone https://github.com/rwightman/pytorch-image-models\ncd pytorch-image-models\ngit checkout c2ba229d995c33aaaf20e00a5686b4dc857044be\npip install -e .\n```\n- fvcore (optional, for FLOPs calculation)\n- mmcv, mmdetection, mmsegmentation (optional)\n\n### Data preparation\n\nDownload and extract ImageNet train and val images from http://image-net.org/.\nThe directory structure is:\n\n```\n│path/to/imagenet/\n├──train/\n│  ├── n01440764\n│  │   ├── n01440764_10026.JPEG\n│  │   ├── n01440764_10027.JPEG\n│  │   ├── ......\n│  ├── ......\n├──val/\n│  ├── n01440764\n│  │   ├── ILSVRC2012_val_00000293.JPEG\n│  │   ├── ILSVRC2012_val_00002138.JPEG\n│  │   ├── ......\n│  ├── ......\n```\n\n### Evaluation\nTo evaluate a pre-trained CycleMLP-B5 on ImageNet val with a single GPU run:\n```\npython main.py --eval --model CycleMLP_B5 --resume path/to/CycleMLP_B5.pth --data-path /path/to/imagenet\n```\n\n\n### Training\n\nTo train CycleMLP-B5 on ImageNet on a single node with 8 gpus for 300 epochs run:\n```\npython -m torch.distributed.launch --nproc_per_node=8 --use_env main.py --model CycleMLP_B5 --batch-size 128 --data-path /path/to/imagenet --output_dir /path/to/save\n```\n### Acknowledgement\nThis code is based on [DeiT](https://github.com/facebookresearch/deit) and [pytorch-image-models](https://github.com/rwightman/pytorch-image-models). Thanks for their wonderful works\n\n\n## Citing\n\n```bibtex\n@inproceedings{\nchen2022cyclemlp,\ntitle={Cycle{MLP}: A {MLP}-like Architecture for Dense Prediction},\nauthor={Shoufa Chen and Enze Xie and Chongjian GE and Runjian Chen and Ding Liang and Ping Luo},\nbooktitle={International Conference on Learning Representations},\nyear={2022},\nurl={https://openreview.net/forum?id=NMEceG4v69Y}\n}\n```\n\n## License\n\nCycleMLP is released under MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshoufachen%2Fcyclemlp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshoufachen%2Fcyclemlp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshoufachen%2Fcyclemlp/lists"}