Instructions to use amd/resnet50 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use amd/resnet50 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="amd/resnet50") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("amd/resnet50") model = AutoModelForImageClassification.from_pretrained("amd/resnet50", device_map="auto") - Notebooks
- Google Colab
- Kaggle
| license: apache-2.0 | |
| datasets: | |
| - imagenet-1k | |
| metrics: | |
| - accuracy | |
| tags: | |
| - RyzenAI | |
| - vision | |
| - classification | |
| - pytorch | |
| # ResNet-50 v1.5 | |
| Quantized ResNet model that could be supported by [AMD Ryzen AI](https://ryzenai.docs.amd.com/en/latest/). | |
| ## Model description | |
| ResNet (Residual Network) was first introduced in the paper Deep Residual Learning for Image Recognition by He et al. | |
| This model is ResNet50 v1.5 from [torchvision](https://pytorch.org/vision/main/models/generated/torchvision.models.resnet50.html). | |
| ## How to use | |
| ### Installation | |
| Follow [Ryzen AI Installation](https://ryzenai.docs.amd.com/en/latest/inst.html) to prepare the environment for Ryzen AI. | |
| Run the following script to install pre-requisites for this model. | |
| ```bash | |
| pip install -r requirements.txt | |
| ``` | |
| ### Data Preparation | |
| Follow [PyTorch Example](https://github.com/pytorch/examples/blob/main/imagenet/README.md#requirements) to prepare dataset. | |
| ### Model Evaluation | |
| ```python | |
| python eval_onnx.py --onnx_model ResNet_int.onnx --ipu --provider_config Path\To\vaip_config.json --data_dir /Path/To/Your/Dataset | |
| ``` | |
| ### Performance | |
| |Metric |Accuracy on IPU| | |
| | :----: | :----: | | |
| |Top1/Top5| 76.17% / 92.86%| | |
| ```bibtex | |
| @article{He2015, | |
| author={Kaiming He and Xiangyu Zhang and Shaoqing Ren and Jian Sun}, | |
| title={Deep Residual Learning for Image Recognition}, | |
| journal={arXiv preprint arXiv:1512.03385}, | |
| year={2015} | |
| } | |
| ``` |