Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yangle15/RANet-pytorch
Resolution adaptive network
https://github.com/yangle15/RANet-pytorch
Last synced: 24 days ago
JSON representation
Resolution adaptive network
- Host: GitHub
- URL: https://github.com/yangle15/RANet-pytorch
- Owner: yangle15
- Created: 2020-02-27T07:14:40.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-07-17T09:03:07.000Z (over 2 years ago)
- Last Synced: 2024-08-09T13:19:07.131Z (4 months ago)
- Language: Python
- Size: 1.1 MB
- Stars: 145
- Watchers: 5
- Forks: 28
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- StarryDivineSky - yangle15/RANet-pytorch
README
# Resolution Adaptive Networks for Efficient Inference (CVPR2020)
[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)This 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.
## Results
Accuracy (top-1) of anytime prediction models as a function of computational budget on the CIFAR-10 (left), CIFAR-100
(middle) and ImageNet (right) datasets. Higher is better.Accuracy (top-1) of budgeted batch classification models as a function of average computational budget per image the on CIFAR-
10 (left), CIFAR-100 (middle) and ImageNet (right) datasets. Higher is better.## Dependencies:
* Python3
* PyTorch >= 1.0
## Usage
We Provide shell scripts for training a RANet on CIFAR and ImageNet.### Train a RANet on CIFAR
* Modify the train_cifar.sh to config your path to the dataset, your GPU devices and your saving directory. Then run
```sh
bash train_cifar.sh
```* You can train your RANet with other configurations.
```sh
python 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'
```### Train a RANet on ImageNet
* Modify the train_imagenet.sh to config your path to the dataset, your GPU devices and your saving directory. Then run
```sh
bash train_imagenet.sh
```* You can train your RANet with other configurations.
```sh
python 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'
```### Citation
If you find this work useful or use our codes in your own research, please use the following bibtex:
```
@inproceedings{yang2020resolution,
title={Resolution Adaptive Networks for Efficient Inference},
author={Yang, Le and Han, Yizeng and Chen, Xi and Song, Shiji and Dai, Jifeng and Huang, Gao},
booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
year={2020}
}
```### Contact
If you have any questions, please feel free to contact the authors.Le Yang: [email protected]
Yizeng Han: [[email protected]](mailto:[email protected])
### Acknowledgments
We use the pytorch implementation of MSDNet in our experiments. The code can be found [here](https://github.com/kalviny/MSDNet-PyTorch).