qaihm-bot commited on
Commit
96e2c01
·
verified ·
1 Parent(s): 2c41550

See https://github.com/quic/ai-hub-models/releases/v0.46.1 for changelog.

EfficientNet-B0_float.dlc DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:12be13d18cd7f0b971f47d335ecb1baa07c8997fae43eeafd7377b1e1af41504
3
- size 21334012
 
 
 
 
EfficientNet-B0_float.onnx.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:01afa61b6e9bc95de58c2f296a29a5595b9625ed0eecc4844fb2a09a8ff9ae04
3
- size 19669112
 
 
 
 
EfficientNet-B0_float.tflite DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:e0c4f6f8498b3df10bd1083ad5ab0b69c48b42a353426246f9bdf7a54e3ffe4a
3
- size 21124920
 
 
 
 
EfficientNet-B0_w8a16.dlc DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:ba2772a45eb2ce060e349ab374877d2414545625fe216e4fcfac240a89ca3b58
3
- size 7341164
 
 
 
 
EfficientNet-B0_w8a16.onnx.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:0da7eeade1b1fa40b40efb63a9521efc4204dc1fb8b8fdfb588a7c72db2e5189
3
- size 11215336
 
 
 
 
README.md CHANGED
@@ -11,267 +11,117 @@ pipeline_tag: image-classification
11
 
12
  ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/efficientnet_b0/web-assets/model_demo.png)
13
 
14
- # EfficientNet-B0: Optimized for Mobile Deployment
15
- ## Imagenet classifier and general purpose backbone
16
-
17
 
18
  EfficientNetB0 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.
19
 
20
- This model is an implementation of EfficientNet-B0 found [here](https://github.com/pytorch/vision/blob/main/torchvision/models/efficientnet.py).
21
-
22
-
23
- This repository provides scripts to run EfficientNet-B0 on Qualcomm® devices.
24
- More details on model performance across various devices, can be found
25
- [here](https://aihub.qualcomm.com/models/efficientnet_b0).
26
-
27
-
28
-
29
- ### Model Details
30
-
31
- - **Model Type:** Model_use_case.image_classification
32
- - **Model Stats:**
33
- - Model checkpoint: Imagenet
34
- - Input resolution: 224x224
35
- - Number of parameters: 5.27M
36
- - Model size (float): 20.1 MB
37
- - Model size (w8a16): 6.99 MB
38
-
39
- | Model | Precision | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit | Target Model
40
- |---|---|---|---|---|---|---|---|---|
41
- | EfficientNet-B0 | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 4.794 ms | 0 - 136 MB | NPU | [EfficientNet-B0.tflite](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.tflite) |
42
- | EfficientNet-B0 | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | QNN_DLC | 4.759 ms | 1 - 130 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.dlc) |
43
- | EfficientNet-B0 | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 3.447 ms | 0 - 176 MB | NPU | [EfficientNet-B0.tflite](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.tflite) |
44
- | EfficientNet-B0 | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | QNN_DLC | 3.454 ms | 1 - 166 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.dlc) |
45
- | EfficientNet-B0 | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 1.466 ms | 0 - 3 MB | NPU | [EfficientNet-B0.tflite](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.tflite) |
46
- | EfficientNet-B0 | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | QNN_DLC | 1.464 ms | 1 - 3 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.dlc) |
47
- | EfficientNet-B0 | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | ONNX | 1.406 ms | 0 - 17 MB | NPU | [EfficientNet-B0.onnx.zip](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.onnx.zip) |
48
- | EfficientNet-B0 | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 1.986 ms | 0 - 136 MB | NPU | [EfficientNet-B0.tflite](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.tflite) |
49
- | EfficientNet-B0 | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | QNN_DLC | 1.96 ms | 1 - 130 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.dlc) |
50
- | EfficientNet-B0 | float | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 4.794 ms | 0 - 136 MB | NPU | [EfficientNet-B0.tflite](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.tflite) |
51
- | EfficientNet-B0 | float | SA7255P ADP | Qualcomm® SA7255P | QNN_DLC | 4.759 ms | 1 - 130 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.dlc) |
52
- | EfficientNet-B0 | float | SA8295P ADP | Qualcomm® SA8295P | TFLITE | 3.554 ms | 0 - 151 MB | NPU | [EfficientNet-B0.tflite](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.tflite) |
53
- | EfficientNet-B0 | float | SA8295P ADP | Qualcomm® SA8295P | QNN_DLC | 3.524 ms | 0 - 144 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.dlc) |
54
- | EfficientNet-B0 | float | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 1.986 ms | 0 - 136 MB | NPU | [EfficientNet-B0.tflite](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.tflite) |
55
- | EfficientNet-B0 | float | SA8775P ADP | Qualcomm® SA8775P | QNN_DLC | 1.96 ms | 1 - 130 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.dlc) |
56
- | EfficientNet-B0 | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 1.03 ms | 0 - 170 MB | NPU | [EfficientNet-B0.tflite](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.tflite) |
57
- | EfficientNet-B0 | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | QNN_DLC | 1.027 ms | 1 - 163 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.dlc) |
58
- | EfficientNet-B0 | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 1.001 ms | 0 - 137 MB | NPU | [EfficientNet-B0.onnx.zip](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.onnx.zip) |
59
- | EfficientNet-B0 | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | TFLITE | 0.795 ms | 0 - 141 MB | NPU | [EfficientNet-B0.tflite](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.tflite) |
60
- | EfficientNet-B0 | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | QNN_DLC | 0.79 ms | 0 - 135 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.dlc) |
61
- | EfficientNet-B0 | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | ONNX | 0.815 ms | 0 - 107 MB | NPU | [EfficientNet-B0.onnx.zip](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.onnx.zip) |
62
- | EfficientNet-B0 | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | TFLITE | 0.615 ms | 0 - 139 MB | NPU | [EfficientNet-B0.tflite](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.tflite) |
63
- | EfficientNet-B0 | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | QNN_DLC | 0.616 ms | 1 - 133 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.dlc) |
64
- | EfficientNet-B0 | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | ONNX | 0.667 ms | 0 - 109 MB | NPU | [EfficientNet-B0.onnx.zip](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.onnx.zip) |
65
- | EfficientNet-B0 | float | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN_DLC | 1.678 ms | 1 - 1 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.dlc) |
66
- | EfficientNet-B0 | float | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 1.373 ms | 13 - 13 MB | NPU | [EfficientNet-B0.onnx.zip](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0.onnx.zip) |
67
- | EfficientNet-B0 | w8a16 | Dragonwing Q-6690 MTP | Qualcomm® QCM6690 | QNN_DLC | 6.543 ms | 0 - 145 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0_w8a16.dlc) |
68
- | EfficientNet-B0 | w8a16 | Dragonwing Q-6690 MTP | Qualcomm® QCM6690 | ONNX | 66.566 ms | 44 - 60 MB | CPU | [EfficientNet-B0.onnx.zip](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0_w8a16.onnx.zip) |
69
- | EfficientNet-B0 | w8a16 | Dragonwing RB3 Gen 2 Vision Kit | Qualcomm® QCS6490 | QNN_DLC | 4.329 ms | 2 - 4 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0_w8a16.dlc) |
70
- | EfficientNet-B0 | w8a16 | Dragonwing RB3 Gen 2 Vision Kit | Qualcomm® QCS6490 | ONNX | 113.856 ms | 41 - 45 MB | CPU | [EfficientNet-B0.onnx.zip](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0_w8a16.onnx.zip) |
71
- | EfficientNet-B0 | w8a16 | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | QNN_DLC | 3.322 ms | 0 - 138 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0_w8a16.dlc) |
72
- | EfficientNet-B0 | w8a16 | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | QNN_DLC | 1.951 ms | 0 - 166 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0_w8a16.dlc) |
73
- | EfficientNet-B0 | w8a16 | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | QNN_DLC | 1.672 ms | 0 - 2 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0_w8a16.dlc) |
74
- | EfficientNet-B0 | w8a16 | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | ONNX | 1.658 ms | 0 - 9 MB | NPU | [EfficientNet-B0.onnx.zip](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0_w8a16.onnx.zip) |
75
- | EfficientNet-B0 | w8a16 | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | QNN_DLC | 1.961 ms | 0 - 137 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0_w8a16.dlc) |
76
- | EfficientNet-B0 | w8a16 | SA7255P ADP | Qualcomm® SA7255P | QNN_DLC | 3.322 ms | 0 - 138 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0_w8a16.dlc) |
77
- | EfficientNet-B0 | w8a16 | SA8295P ADP | Qualcomm® SA8295P | QNN_DLC | 2.349 ms | 0 - 143 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0_w8a16.dlc) |
78
- | EfficientNet-B0 | w8a16 | SA8775P ADP | Qualcomm® SA8775P | QNN_DLC | 1.961 ms | 0 - 137 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0_w8a16.dlc) |
79
- | EfficientNet-B0 | w8a16 | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | QNN_DLC | 1.142 ms | 0 - 164 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0_w8a16.dlc) |
80
- | EfficientNet-B0 | w8a16 | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 1.086 ms | 0 - 149 MB | NPU | [EfficientNet-B0.onnx.zip](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0_w8a16.onnx.zip) |
81
- | EfficientNet-B0 | w8a16 | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | QNN_DLC | 0.782 ms | 0 - 141 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0_w8a16.dlc) |
82
- | EfficientNet-B0 | w8a16 | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | ONNX | 0.806 ms | 0 - 124 MB | NPU | [EfficientNet-B0.onnx.zip](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0_w8a16.onnx.zip) |
83
- | EfficientNet-B0 | w8a16 | Snapdragon 7 Gen 4 QRD | Snapdragon® 7 Gen 4 Mobile | QNN_DLC | 1.706 ms | 0 - 141 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0_w8a16.dlc) |
84
- | EfficientNet-B0 | w8a16 | Snapdragon 7 Gen 4 QRD | Snapdragon® 7 Gen 4 Mobile | ONNX | 57.935 ms | 43 - 60 MB | CPU | [EfficientNet-B0.onnx.zip](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0_w8a16.onnx.zip) |
85
- | EfficientNet-B0 | w8a16 | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | QNN_DLC | 0.647 ms | 0 - 140 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0_w8a16.dlc) |
86
- | EfficientNet-B0 | w8a16 | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | ONNX | 0.687 ms | 0 - 124 MB | NPU | [EfficientNet-B0.onnx.zip](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0_w8a16.onnx.zip) |
87
- | EfficientNet-B0 | w8a16 | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN_DLC | 1.885 ms | 0 - 0 MB | NPU | [EfficientNet-B0.dlc](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0_w8a16.dlc) |
88
- | EfficientNet-B0 | w8a16 | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 1.611 ms | 6 - 6 MB | NPU | [EfficientNet-B0.onnx.zip](https://huggingface.co/qualcomm/EfficientNet-B0/blob/main/EfficientNet-B0_w8a16.onnx.zip) |
89
-
90
-
91
-
92
-
93
- ## Installation
94
-
95
-
96
- Install the package via pip:
97
- ```bash
98
- pip install qai-hub-models
99
- ```
100
-
101
-
102
- ## Configure Qualcomm® AI Hub Workbench to run this model on a cloud-hosted device
103
-
104
- Sign-in to [Qualcomm® AI Hub Workbench](https://workbench.aihub.qualcomm.com/) with your
105
- Qualcomm® ID. Once signed in navigate to `Account -> Settings -> API Token`.
106
-
107
- With this API token, you can configure your client to run models on the cloud
108
- hosted devices.
109
- ```bash
110
- qai-hub configure --api_token API_TOKEN
111
- ```
112
- Navigate to [docs](https://workbench.aihub.qualcomm.com/docs/) for more information.
113
-
114
-
115
-
116
- ## Demo off target
117
-
118
- The package contains a simple end-to-end demo that downloads pre-trained
119
- weights and runs this model on a sample input.
120
-
121
- ```bash
122
- python -m qai_hub_models.models.efficientnet_b0.demo
123
- ```
124
-
125
- The above demo runs a reference implementation of pre-processing, model
126
- inference, and post processing.
127
-
128
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
129
- environment, please add the following to your cell (instead of the above).
130
- ```
131
- %run -m qai_hub_models.models.efficientnet_b0.demo
132
- ```
133
-
134
-
135
- ### Run model on a cloud-hosted device
136
-
137
- In addition to the demo, you can also run the model on a cloud-hosted Qualcomm®
138
- device. This script does the following:
139
- * Performance check on-device on a cloud-hosted device
140
- * Downloads compiled assets that can be deployed on-device for Android.
141
- * Accuracy check between PyTorch and on-device outputs.
142
-
143
- ```bash
144
- python -m qai_hub_models.models.efficientnet_b0.export
145
- ```
146
-
147
-
148
-
149
- ## How does this work?
150
-
151
- This [export script](https://aihub.qualcomm.com/models/efficientnet_b0/qai_hub_models/models/EfficientNet-B0/export.py)
152
- leverages [Qualcomm® AI Hub](https://aihub.qualcomm.com/) to optimize, validate, and deploy this model
153
- on-device. Lets go through each step below in detail:
154
-
155
- Step 1: **Compile model for on-device deployment**
156
-
157
- To compile a PyTorch model for on-device deployment, we first trace the model
158
- in memory using the `jit.trace` and then call the `submit_compile_job` API.
159
-
160
- ```python
161
- import torch
162
-
163
- import qai_hub as hub
164
- from qai_hub_models.models.efficientnet_b0 import Model
165
-
166
- # Load the model
167
- torch_model = Model.from_pretrained()
168
-
169
- # Device
170
- device = hub.Device("Samsung Galaxy S25")
171
-
172
- # Trace model
173
- input_shape = torch_model.get_input_spec()
174
- sample_inputs = torch_model.sample_inputs()
175
-
176
- pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
177
-
178
- # Compile model on a specific device
179
- compile_job = hub.submit_compile_job(
180
- model=pt_model,
181
- device=device,
182
- input_specs=torch_model.get_input_spec(),
183
- )
184
-
185
- # Get target model to run on-device
186
- target_model = compile_job.get_target_model()
187
-
188
- ```
189
-
190
-
191
- Step 2: **Performance profiling on cloud-hosted device**
192
-
193
- After compiling models from step 1. Models can be profiled model on-device using the
194
- `target_model`. Note that this scripts runs the model on a device automatically
195
- provisioned in the cloud. Once the job is submitted, you can navigate to a
196
- provided job URL to view a variety of on-device performance metrics.
197
- ```python
198
- profile_job = hub.submit_profile_job(
199
- model=target_model,
200
- device=device,
201
- )
202
-
203
- ```
204
-
205
- Step 3: **Verify on-device accuracy**
206
-
207
- To verify the accuracy of the model on-device, you can run on-device inference
208
- on sample input data on the same cloud hosted device.
209
- ```python
210
- input_data = torch_model.sample_inputs()
211
- inference_job = hub.submit_inference_job(
212
- model=target_model,
213
- device=device,
214
- inputs=input_data,
215
- )
216
- on_device_output = inference_job.download_output_data()
217
-
218
- ```
219
- With the output of the model, you can compute like PSNR, relative errors or
220
- spot check the output with expected output.
221
-
222
- **Note**: This on-device profiling and inference requires access to Qualcomm®
223
- AI Hub Workbench. [Sign up for access](https://myaccount.qualcomm.com/signup).
224
-
225
-
226
-
227
- ## Run demo on a cloud-hosted device
228
-
229
- You can also run the demo on-device.
230
-
231
- ```bash
232
- python -m qai_hub_models.models.efficientnet_b0.demo --eval-mode on-device
233
- ```
234
-
235
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
236
- environment, please add the following to your cell (instead of the above).
237
- ```
238
- %run -m qai_hub_models.models.efficientnet_b0.demo -- --eval-mode on-device
239
- ```
240
-
241
-
242
- ## Deploying compiled model to Android
243
-
244
-
245
- The models can be deployed using multiple runtimes:
246
- - TensorFlow Lite (`.tflite` export): [This
247
- tutorial](https://www.tensorflow.org/lite/android/quickstart) provides a
248
- guide to deploy the .tflite model in an Android application.
249
-
250
-
251
- - QNN (`.so` export ): This [sample
252
- app](https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-50/sample_app.html)
253
- provides instructions on how to use the `.so` shared library in an Android application.
254
-
255
-
256
- ## View on Qualcomm® AI Hub
257
- Get more details on EfficientNet-B0's performance across various devices [here](https://aihub.qualcomm.com/models/efficientnet_b0).
258
- Explore all available models on [Qualcomm® AI Hub](https://aihub.qualcomm.com/)
259
-
260
 
261
  ## License
262
  * The license for the original implementation of EfficientNet-B0 can be found
263
  [here](https://github.com/pytorch/vision/blob/main/LICENSE).
264
 
265
-
266
-
267
  ## References
268
  * [EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks](https://arxiv.org/abs/1905.11946)
269
  * [Source Model Implementation](https://github.com/pytorch/vision/blob/main/torchvision/models/efficientnet.py)
270
 
271
-
272
-
273
  ## Community
274
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
275
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
276
-
277
-
 
11
 
12
  ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/efficientnet_b0/web-assets/model_demo.png)
13
 
14
+ # EfficientNet-B0: Optimized for Qualcomm Devices
 
 
15
 
16
  EfficientNetB0 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.
17
 
18
+ This is based on the implementation of EfficientNet-B0 found [here](https://github.com/pytorch/vision/blob/main/torchvision/models/efficientnet.py).
19
+ This repository contains pre-exported model files optimized for Qualcomm® devices. You can use the [Qualcomm® AI Hub Models](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/efficientnet_b0) library to export with custom configurations. More details on model performance across various devices, can be found [here](#performance-summary).
20
+
21
+ Qualcomm AI Hub Models uses [Qualcomm AI Hub Workbench](https://workbench.aihub.qualcomm.com) to compile, profile, and evaluate this model. [Sign up](https://myaccount.qualcomm.com/signup) to run these models on a hosted Qualcomm® device.
22
+
23
+ ## Getting Started
24
+ There are two ways to deploy this model on your device:
25
+
26
+ ### Option 1: Download Pre-Exported Models
27
+
28
+ Below are pre-exported model assets ready for deployment.
29
+
30
+ | Runtime | Precision | Chipset | SDK Versions | Download |
31
+ |---|---|---|---|---|
32
+ | ONNX | float | Universal | QAIRT 2.37, ONNX Runtime 1.23.0 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/efficientnet_b0/releases/v0.46.1/efficientnet_b0-onnx-float.zip)
33
+ | ONNX | w8a16 | Universal | QAIRT 2.37, ONNX Runtime 1.23.0 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/efficientnet_b0/releases/v0.46.1/efficientnet_b0-onnx-w8a16.zip)
34
+ | QNN_DLC | float | Universal | QAIRT 2.42 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/efficientnet_b0/releases/v0.46.1/efficientnet_b0-qnn_dlc-float.zip)
35
+ | QNN_DLC | w8a16 | Universal | QAIRT 2.42 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/efficientnet_b0/releases/v0.46.1/efficientnet_b0-qnn_dlc-w8a16.zip)
36
+ | TFLITE | float | Universal | QAIRT 2.42, TFLite 2.17.0 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/efficientnet_b0/releases/v0.46.1/efficientnet_b0-tflite-float.zip)
37
+
38
+ For more device-specific assets and performance metrics, visit **[EfficientNet-B0 on Qualcomm® AI Hub](https://aihub.qualcomm.com/models/efficientnet_b0)**.
39
+
40
+
41
+ ### Option 2: Export with Custom Configurations
42
+
43
+ Use the [Qualcomm® AI Hub Models](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/efficientnet_b0) Python library to compile and export the model with your own:
44
+ - Custom weights (e.g., fine-tuned checkpoints)
45
+ - Custom input shapes
46
+ - Target device and runtime configurations
47
+
48
+ This option is ideal if you need to customize the model beyond the default configuration provided here.
49
+
50
+ See our repository for [EfficientNet-B0 on GitHub](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/efficientnet_b0) for usage instructions.
51
+
52
+ ## Model Details
53
+
54
+ **Model Type:** Model_use_case.image_classification
55
+
56
+ **Model Stats:**
57
+ - Model checkpoint: Imagenet
58
+ - Input resolution: 224x224
59
+ - Number of parameters: 5.27M
60
+ - Model size (float): 20.1 MB
61
+ - Model size (w8a16): 6.99 MB
62
+
63
+ ## Performance Summary
64
+ | Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit
65
+ |---|---|---|---|---|---|---
66
+ | EfficientNet-B0 | ONNX | float | Snapdragon® X Elite | 1.391 ms | 13 - 13 MB | NPU
67
+ | EfficientNet-B0 | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 1.063 ms | 0 - 134 MB | NPU
68
+ | EfficientNet-B0 | ONNX | float | Qualcomm® QCS8550 (Proxy) | 1.402 ms | 0 - 24 MB | NPU
69
+ | EfficientNet-B0 | ONNX | float | Qualcomm® QCS9075 | 1.877 ms | 1 - 3 MB | NPU
70
+ | EfficientNet-B0 | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 0.839 ms | 0 - 108 MB | NPU
71
+ | EfficientNet-B0 | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.659 ms | 0 - 107 MB | NPU
72
+ | EfficientNet-B0 | ONNX | w8a16 | Snapdragon® X Elite | 1.618 ms | 6 - 6 MB | NPU
73
+ | EfficientNet-B0 | ONNX | w8a16 | Snapdragon® 8 Gen 3 Mobile | 1.155 ms | 0 - 146 MB | NPU
74
+ | EfficientNet-B0 | ONNX | w8a16 | Qualcomm® QCS6490 | 122.425 ms | 42 - 44 MB | CPU
75
+ | EfficientNet-B0 | ONNX | w8a16 | Qualcomm® QCS8550 (Proxy) | 1.634 ms | 0 - 10 MB | NPU
76
+ | EfficientNet-B0 | ONNX | w8a16 | Qualcomm® QCS9075 | 1.851 ms | 0 - 3 MB | NPU
77
+ | EfficientNet-B0 | ONNX | w8a16 | Qualcomm® QCM6690 | 66.291 ms | 42 - 51 MB | CPU
78
+ | EfficientNet-B0 | ONNX | w8a16 | Snapdragon® 8 Elite For Galaxy Mobile | 0.816 ms | 0 - 124 MB | NPU
79
+ | EfficientNet-B0 | ONNX | w8a16 | Snapdragon® 7 Gen 4 Mobile | 54.16 ms | 49 - 58 MB | CPU
80
+ | EfficientNet-B0 | ONNX | w8a16 | Snapdragon® 8 Elite Gen 5 Mobile | 0.699 ms | 0 - 123 MB | NPU
81
+ | EfficientNet-B0 | QNN_DLC | float | Snapdragon® X Elite | 1.756 ms | 1 - 1 MB | NPU
82
+ | EfficientNet-B0 | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 1.076 ms | 0 - 63 MB | NPU
83
+ | EfficientNet-B0 | QNN_DLC | float | Qualcomm® QCS8275 (Proxy) | 4.898 ms | 1 - 38 MB | NPU
84
+ | EfficientNet-B0 | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 1.554 ms | 1 - 2 MB | NPU
85
+ | EfficientNet-B0 | QNN_DLC | float | Qualcomm® SA8775P | 8.846 ms | 1 - 39 MB | NPU
86
+ | EfficientNet-B0 | QNN_DLC | float | Qualcomm® QCS9075 | 1.857 ms | 3 - 5 MB | NPU
87
+ | EfficientNet-B0 | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 3.601 ms | 0 - 73 MB | NPU
88
+ | EfficientNet-B0 | QNN_DLC | float | Qualcomm® SA7255P | 4.898 ms | 1 - 38 MB | NPU
89
+ | EfficientNet-B0 | QNN_DLC | float | Qualcomm® SA8295P | 3.614 ms | 0 - 45 MB | NPU
90
+ | EfficientNet-B0 | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 0.806 ms | 1 - 44 MB | NPU
91
+ | EfficientNet-B0 | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.614 ms | 1 - 44 MB | NPU
92
+ | EfficientNet-B0 | QNN_DLC | w8a16 | Snapdragon® X Elite | 1.896 ms | 0 - 0 MB | NPU
93
+ | EfficientNet-B0 | QNN_DLC | w8a16 | Snapdragon® 8 Gen 3 Mobile | 1.126 ms | 0 - 65 MB | NPU
94
+ | EfficientNet-B0 | QNN_DLC | w8a16 | Qualcomm® QCS6490 | 4.316 ms | 0 - 2 MB | NPU
95
+ | EfficientNet-B0 | QNN_DLC | w8a16 | Qualcomm® QCS8275 (Proxy) | 3.293 ms | 0 - 45 MB | NPU
96
+ | EfficientNet-B0 | QNN_DLC | w8a16 | Qualcomm® QCS8550 (Proxy) | 1.677 ms | 0 - 2 MB | NPU
97
+ | EfficientNet-B0 | QNN_DLC | w8a16 | Qualcomm® SA8775P | 1.944 ms | 0 - 49 MB | NPU
98
+ | EfficientNet-B0 | QNN_DLC | w8a16 | Qualcomm® QCS9075 | 1.857 ms | 2 - 4 MB | NPU
99
+ | EfficientNet-B0 | QNN_DLC | w8a16 | Qualcomm® QCM6690 | 6.533 ms | 0 - 163 MB | NPU
100
+ | EfficientNet-B0 | QNN_DLC | w8a16 | Qualcomm® QCS8450 (Proxy) | 1.977 ms | 0 - 67 MB | NPU
101
+ | EfficientNet-B0 | QNN_DLC | w8a16 | Qualcomm® SA7255P | 3.293 ms | 0 - 45 MB | NPU
102
+ | EfficientNet-B0 | QNN_DLC | w8a16 | Qualcomm® SA8295P | 2.358 ms | 0 - 43 MB | NPU
103
+ | EfficientNet-B0 | QNN_DLC | w8a16 | Snapdragon® 8 Elite For Galaxy Mobile | 0.783 ms | 0 - 43 MB | NPU
104
+ | EfficientNet-B0 | QNN_DLC | w8a16 | Snapdragon® 7 Gen 4 Mobile | 1.674 ms | 0 - 47 MB | NPU
105
+ | EfficientNet-B0 | QNN_DLC | w8a16 | Snapdragon® 8 Elite Gen 5 Mobile | 0.639 ms | 0 - 48 MB | NPU
106
+ | EfficientNet-B0 | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 1.073 ms | 0 - 77 MB | NPU
107
+ | EfficientNet-B0 | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 4.911 ms | 0 - 46 MB | NPU
108
+ | EfficientNet-B0 | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 1.542 ms | 0 - 131 MB | NPU
109
+ | EfficientNet-B0 | TFLITE | float | Qualcomm® SA8775P | 8.913 ms | 0 - 46 MB | NPU
110
+ | EfficientNet-B0 | TFLITE | float | Qualcomm® QCS9075 | 1.877 ms | 0 - 16 MB | NPU
111
+ | EfficientNet-B0 | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 3.616 ms | 0 - 80 MB | NPU
112
+ | EfficientNet-B0 | TFLITE | float | Qualcomm® SA7255P | 4.911 ms | 0 - 46 MB | NPU
113
+ | EfficientNet-B0 | TFLITE | float | Qualcomm® SA8295P | 3.657 ms | 0 - 52 MB | NPU
114
+ | EfficientNet-B0 | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 0.811 ms | 0 - 45 MB | NPU
115
+ | EfficientNet-B0 | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.612 ms | 0 - 50 MB | NPU
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
 
117
  ## License
118
  * The license for the original implementation of EfficientNet-B0 can be found
119
  [here](https://github.com/pytorch/vision/blob/main/LICENSE).
120
 
 
 
121
  ## References
122
  * [EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks](https://arxiv.org/abs/1905.11946)
123
  * [Source Model Implementation](https://github.com/pytorch/vision/blob/main/torchvision/models/efficientnet.py)
124
 
 
 
125
  ## Community
126
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
127
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
 
 
tool-versions.yaml DELETED
@@ -1,4 +0,0 @@
1
- tool_versions:
2
- onnx:
3
- qairt: 2.37.1.250807093845_124904
4
- onnx_runtime: 1.23.0