ResNet152: Imagenet classifier and general purpose backbone
ResNet152 is a machine learning model that can classify images from the Imagenet dataset. It can also be used as a backbone in building more complex models for specific use cases.
This is based on the implementation of ResNet152 found here. This is a standalone recipe compatible with the Qualcomm® AI Hub Models CLI — it can be installed, compiled, and evaluated on real Snapdragon devices via Qualcomm® AI Hub Workbench.
Qualcomm AI Hub Models uses Qualcomm AI Hub Workbench to compile, profile, and evaluate this model. Sign up to run these models on a hosted Qualcomm® device.
Use this recipe
Register it under a short name, then run it locally or compile it for a device:
qai-hub-models register my_model ashwmurt/resnet152
qai-hub-models demo my_model
qai-hub-models export my_model
Setup
1. Install the package
Install the base package, then use the qai-hub-models CLI to install this
recipe's dependencies:
# NOTE: 3.10 <= PYTHON_VERSION < 3.14 is supported.
pip install qai-hub-models
qai-hub-models install resnet152
2. Configure Qualcomm® AI Hub Workbench
Sign-in to Qualcomm® AI Hub Workbench with your
Qualcomm® ID. Once signed in navigate to Account -> Settings -> API Token.
With this API token, you can configure your client to run models on the cloud hosted devices.
qai-hub configure --api_token API_TOKEN
Navigate to docs for more information.
Run CLI Demo
Run the following simple CLI demo to verify the model is working end to end:
qai-hub-models demo resnet152
More details on the CLI tool can be found with the --help option. See
demo.py for sample usage of the model including pre/post processing
scripts.
By default, the demo will run locally in PyTorch. Pass --eval-mode on-device to run the model on a cloud-hosted target device.
Export for on-device deployment
To run the model on Qualcomm® devices, you must export the model for use with an edge runtime such as TensorFlow Lite, ONNX Runtime, or Qualcomm AI Engine Direct. Use the following command to export the model:
qai-hub-models export resnet152 --target-runtime tflite --precision float
Additional options are documented with the --help option.
License
- The license for the original implementation of ResNet152 can be found here.
References
Community
- Join our AI Hub Slack community to collaborate, post questions and learn more about on-device AI.
- For questions or feedback please reach out to us.