{"id":13958455,"url":"https://github.com/yangle15/RANet-pytorch","last_synced_at":"2025-07-21T00:30:51.639Z","repository":{"id":47710911,"uuid":"243455469","full_name":"yangle15/RANet-pytorch","owner":"yangle15","description":"Resolution adaptive network","archived":false,"fork":false,"pushed_at":"2022-07-17T09:03:07.000Z","size":1157,"stargazers_count":149,"open_issues_count":0,"forks_count":28,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-28T02:34:44.662Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/yangle15.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}},"created_at":"2020-02-27T07:14:40.000Z","updated_at":"2024-09-06T10:12:51.000Z","dependencies_parsed_at":"2022-08-03T02:45:55.629Z","dependency_job_id":null,"html_url":"https://github.com/yangle15/RANet-pytorch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yangle15/RANet-pytorch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangle15%2FRANet-pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangle15%2FRANet-pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangle15%2FRANet-pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangle15%2FRANet-pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yangle15","download_url":"https://codeload.github.com/yangle15/RANet-pytorch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yangle15%2FRANet-pytorch/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266221247,"owners_count":23894964,"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":[],"created_at":"2024-08-08T13:01:36.416Z","updated_at":"2025-07-21T00:30:51.232Z","avatar_url":"https://github.com/yangle15.png","language":"Python","funding_links":[],"categories":["其他_机器视觉"],"sub_categories":["网络服务_其他"],"readme":"# Resolution Adaptive Networks for Efficient Inference (CVPR2020)\n[Le Yang*](https://github.com/yangle15), [Yizeng Han*](https://github.com/thuallen), [Xi Chen*](https://github.com/FateDawnLeon), Shiji Song, [Jifeng Dai](https://github.com/daijifeng001), [Gao Huang](https://github.com/gaohuang)\n\nThis repository contains the implementation of the paper, '[Resolution Adaptive Networks for Efficient Inference](https://arxiv.org/pdf/2003.07326.pdf)'. The proposed Resolution Adaptive Networks (RANet) conduct the adaptive inferece by exploiting the ``spatial redundancy`` of input images. Our motivation is that low-resolution representations are sufficient for classifying easy samples containing large objects with prototypical features, while only some hard samples need spatially detailed information, which can be demonstrated by the follow figure.\n\n\u003cdiv align=center\u003e\u003cimg width=\"380\" height=\"410\" src=\"https://github.com/yangle15/RANet-pytorch/blob/master/imgs/RANet_overview.png\"/\u003e\u003c/div\u003e\n\n## Results\n\n\u003cdiv align=center\u003e\u003cimg width=\"800\" height=\"230\" src=\"https://github.com/yangle15/RANet-pytorch/blob/master/imgs/anytime_results.png\"/\u003e\u003c/div\u003e\n\nAccuracy (top-1) of anytime prediction models as a function of computational budget on the CIFAR-10 (left), CIFAR-100\n(middle) and ImageNet (right) datasets. Higher is better.\n\n\u003cdiv align=center\u003e\u003cimg width=\"800\" height=\"230\" src=\"https://github.com/yangle15/RANet-pytorch/blob/master/imgs/dynamic_results.png\"/\u003e\u003c/div\u003e\n\nAccuracy (top-1) of budgeted batch classification models as a function of average computational budget per image the on CIFAR-\n10 (left), CIFAR-100 (middle) and ImageNet (right) datasets. Higher is better.\n\n## Dependencies:\n\n* Python3\n\n* PyTorch \u003e= 1.0\n\n## Usage\nWe Provide shell scripts for training a RANet on CIFAR and ImageNet.\n\n### Train a RANet on CIFAR\n* Modify the train_cifar.sh to config your path to the dataset, your GPU devices and your saving directory. Then run\n```sh\nbash train_cifar.sh\n```\n\n* You can train your RANet with other configurations.\n```sh\npython main.py --arch RANet --gpu '0' --data-root YOUR_DATA_PATH --data 'cifar10' --step 2 --nChannels 16 --stepmode 'lg' --scale-list '1-2-3' --grFactor '4-2-1' --bnFactor '4-2-1'\n```\n\n### Train a RANet on ImageNet\n* Modify the train_imagenet.sh to config your path to the dataset, your GPU devices and your saving directory. Then run\n```sh\nbash train_imagenet.sh\n```\n\n* You can train your RANet with other configurations.\n```sh\npython main.py --arch RANet --gpu '0,1,2,3' --data-root YOUR_DATA_PATH --data 'ImageNet' --step 8 --growthRate 16 --nChannels 32 --stepmode 'even' --scale-list '1-2-3-4' --grFactor '4-2-2-1' --bnFactor '4-2-2-1'\n```\n\n\n\n### Citation\nIf you find this work useful or use our codes in your own research, please use the following bibtex:\n```\n@inproceedings{yang2020resolution,\n  title={Resolution Adaptive Networks for Efficient Inference},\n  author={Yang, Le and Han, Yizeng and Chen, Xi and Song, Shiji and Dai, Jifeng and Huang, Gao},\n  booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},\n  year={2020}\n}\n```\n\n### Contact\nIf you have any questions, please feel free to contact the authors. \n\nLe Yang: yangle15@mails.tsinghua.edu.cn\n\nYizeng Han: [hanyz18@mails.tsinghua.edu.cn](mailto:hanyz18@mails.tsinghua.edu.cn)\n\n### Acknowledgments\nWe use the pytorch implementation of MSDNet in our experiments. The code can be found [here](https://github.com/kalviny/MSDNet-PyTorch).\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyangle15%2FRANet-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyangle15%2FRANet-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyangle15%2FRANet-pytorch/lists"}