qaihm-bot commited on
Commit
d107562
·
verified ·
1 Parent(s): e449a27

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

README.md CHANGED
@@ -10,280 +10,153 @@ pipeline_tag: audio-classification
10
 
11
  ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/yamnet/web-assets/model_demo.png)
12
 
13
- # YamNet: Optimized for Mobile Deployment
14
- ## Audio Event classification Model
15
-
16
 
17
  An audio event classifier trained on the AudioSet dataset to predict audio events from the AudioSet ontology employing the Mobilenet_v1 depthwise-separable convolution architecture.
18
 
19
- This model is an implementation of YamNet found [here](https://github.com/w-hc/torch_audioset).
20
-
21
-
22
- This repository provides scripts to run YamNet on Qualcomm® devices.
23
- More details on model performance across various devices, can be found
24
- [here](https://aihub.qualcomm.com/models/yamnet).
25
-
26
-
27
-
28
- ### Model Details
29
-
30
- - **Model Type:** Model_use_case.audio_classification
31
- - **Model Stats:**
32
- - Model checkpoint: yamnet.pth
33
- - Input resolution: 1x1x96x64
34
- - Number of parameters: 3.73M
35
- - Model size (float): 14.2 MB
36
-
37
- | Model | Precision | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit | Target Model
38
- |---|---|---|---|---|---|---|---|---|
39
- | YamNet | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 0.67 ms | 0 - 122 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.tflite) |
40
- | YamNet | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | QNN_DLC | 0.652 ms | 0 - 115 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.dlc) |
41
- | YamNet | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 0.355 ms | 0 - 150 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.tflite) |
42
- | YamNet | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | QNN_DLC | 0.359 ms | 0 - 137 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.dlc) |
43
- | YamNet | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 0.216 ms | 0 - 2 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.tflite) |
44
- | YamNet | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | QNN_DLC | 0.208 ms | 0 - 2 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.dlc) |
45
- | YamNet | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | ONNX | 0.419 ms | 0 - 10 MB | NPU | [YamNet.onnx.zip](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.onnx.zip) |
46
- | YamNet | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 0.379 ms | 0 - 122 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.tflite) |
47
- | YamNet | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | QNN_DLC | 1.1 ms | 0 - 115 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.dlc) |
48
- | YamNet | float | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 0.67 ms | 0 - 122 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.tflite) |
49
- | YamNet | float | SA7255P ADP | Qualcomm® SA7255P | QNN_DLC | 0.652 ms | 0 - 115 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.dlc) |
50
- | YamNet | float | SA8295P ADP | Qualcomm® SA8295P | TFLITE | 0.548 ms | 0 - 129 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.tflite) |
51
- | YamNet | float | SA8295P ADP | Qualcomm® SA8295P | QNN_DLC | 0.543 ms | 0 - 122 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.dlc) |
52
- | YamNet | float | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 0.379 ms | 0 - 122 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.tflite) |
53
- | YamNet | float | SA8775P ADP | Qualcomm® SA8775P | QNN_DLC | 1.1 ms | 0 - 115 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.dlc) |
54
- | YamNet | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 0.175 ms | 0 - 147 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.tflite) |
55
- | YamNet | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | QNN_DLC | 0.175 ms | 0 - 139 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.dlc) |
56
- | YamNet | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 0.266 ms | 0 - 112 MB | NPU | [YamNet.onnx.zip](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.onnx.zip) |
57
- | YamNet | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | TFLITE | 0.153 ms | 0 - 126 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.tflite) |
58
- | YamNet | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | QNN_DLC | 0.163 ms | 0 - 119 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.dlc) |
59
- | YamNet | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | ONNX | 0.245 ms | 0 - 94 MB | NPU | [YamNet.onnx.zip](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.onnx.zip) |
60
- | YamNet | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | TFLITE | 0.158 ms | 0 - 124 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.tflite) |
61
- | YamNet | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | QNN_DLC | 0.157 ms | 0 - 117 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.dlc) |
62
- | YamNet | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | ONNX | 0.259 ms | 0 - 92 MB | NPU | [YamNet.onnx.zip](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.onnx.zip) |
63
- | YamNet | float | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN_DLC | 0.276 ms | 0 - 0 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.dlc) |
64
- | YamNet | float | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 0.272 ms | 8 - 8 MB | NPU | [YamNet.onnx.zip](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet.onnx.zip) |
65
- | YamNet | w8a8 | Dragonwing Q-6690 MTP | Qualcomm® QCM6690 | TFLITE | 0.422 ms | 0 - 121 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.tflite) |
66
- | YamNet | w8a8 | Dragonwing Q-6690 MTP | Qualcomm® QCM6690 | QNN_DLC | 0.423 ms | 0 - 122 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.dlc) |
67
- | YamNet | w8a8 | Dragonwing Q-6690 MTP | Qualcomm® QCM6690 | ONNX | 0.882 ms | 0 - 14 MB | CPU | [YamNet.onnx.zip](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.onnx.zip) |
68
- | YamNet | w8a8 | Dragonwing RB3 Gen 2 Vision Kit | Qualcomm® QCS6490 | TFLITE | 0.522 ms | 0 - 6 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.tflite) |
69
- | YamNet | w8a8 | Dragonwing RB3 Gen 2 Vision Kit | Qualcomm® QCS6490 | QNN_DLC | 0.635 ms | 0 - 2 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.dlc) |
70
- | YamNet | w8a8 | Dragonwing RB3 Gen 2 Vision Kit | Qualcomm® QCS6490 | ONNX | 1.632 ms | 0 - 7 MB | CPU | [YamNet.onnx.zip](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.onnx.zip) |
71
- | YamNet | w8a8 | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 0.398 ms | 0 - 117 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.tflite) |
72
- | YamNet | w8a8 | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | QNN_DLC | 0.375 ms | 0 - 118 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.dlc) |
73
- | YamNet | w8a8 | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 0.22 ms | 0 - 140 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.tflite) |
74
- | YamNet | w8a8 | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | QNN_DLC | 0.224 ms | 0 - 136 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.dlc) |
75
- | YamNet | w8a8 | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 0.138 ms | 0 - 3 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.tflite) |
76
- | YamNet | w8a8 | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | QNN_DLC | 0.136 ms | 0 - 2 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.dlc) |
77
- | YamNet | w8a8 | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | ONNX | 0.333 ms | 0 - 7 MB | NPU | [YamNet.onnx.zip](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.onnx.zip) |
78
- | YamNet | w8a8 | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 0.295 ms | 0 - 117 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.tflite) |
79
- | YamNet | w8a8 | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | QNN_DLC | 0.274 ms | 0 - 118 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.dlc) |
80
- | YamNet | w8a8 | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 0.398 ms | 0 - 117 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.tflite) |
81
- | YamNet | w8a8 | SA7255P ADP | Qualcomm® SA7255P | QNN_DLC | 0.375 ms | 0 - 118 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.dlc) |
82
- | YamNet | w8a8 | SA8295P ADP | Qualcomm® SA8295P | TFLITE | 0.442 ms | 0 - 123 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.tflite) |
83
- | YamNet | w8a8 | SA8295P ADP | Qualcomm® SA8295P | QNN_DLC | 0.406 ms | 0 - 124 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.dlc) |
84
- | YamNet | w8a8 | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 0.295 ms | 0 - 117 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.tflite) |
85
- | YamNet | w8a8 | SA8775P ADP | Qualcomm® SA8775P | QNN_DLC | 0.274 ms | 0 - 118 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.dlc) |
86
- | YamNet | w8a8 | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 0.11 ms | 0 - 140 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.tflite) |
87
- | YamNet | w8a8 | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | QNN_DLC | 0.112 ms | 0 - 138 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.dlc) |
88
- | YamNet | w8a8 | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 0.206 ms | 0 - 110 MB | NPU | [YamNet.onnx.zip](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.onnx.zip) |
89
- | YamNet | w8a8 | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | TFLITE | 0.097 ms | 0 - 121 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.tflite) |
90
- | YamNet | w8a8 | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | QNN_DLC | 0.091 ms | 0 - 122 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.dlc) |
91
- | YamNet | w8a8 | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | ONNX | 0.197 ms | 0 - 98 MB | NPU | [YamNet.onnx.zip](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.onnx.zip) |
92
- | YamNet | w8a8 | Snapdragon 7 Gen 4 QRD | Snapdragon® 7 Gen 4 Mobile | TFLITE | 0.172 ms | 0 - 122 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.tflite) |
93
- | YamNet | w8a8 | Snapdragon 7 Gen 4 QRD | Snapdragon® 7 Gen 4 Mobile | QNN_DLC | 0.165 ms | 0 - 122 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.dlc) |
94
- | YamNet | w8a8 | Snapdragon 7 Gen 4 QRD | Snapdragon® 7 Gen 4 Mobile | ONNX | 0.714 ms | 0 - 15 MB | CPU | [YamNet.onnx.zip](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.onnx.zip) |
95
- | YamNet | w8a8 | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | TFLITE | 0.088 ms | 0 - 119 MB | NPU | [YamNet.tflite](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.tflite) |
96
- | YamNet | w8a8 | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | QNN_DLC | 0.094 ms | 0 - 120 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.dlc) |
97
- | YamNet | w8a8 | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | ONNX | 0.184 ms | 0 - 96 MB | NPU | [YamNet.onnx.zip](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.onnx.zip) |
98
- | YamNet | w8a8 | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN_DLC | 0.208 ms | 0 - 0 MB | NPU | [YamNet.dlc](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.dlc) |
99
- | YamNet | w8a8 | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 0.224 ms | 4 - 4 MB | NPU | [YamNet.onnx.zip](https://huggingface.co/qualcomm/YamNet/blob/main/YamNet_w8a8.onnx.zip) |
100
-
101
-
102
-
103
-
104
- ## Installation
105
-
106
-
107
- Install the package via pip:
108
- ```bash
109
- # NOTE: 3.10 <= PYTHON_VERSION < 3.14 is supported.
110
- pip install "qai-hub-models[yamnet]" git+https://github.com/w-hc/torch_audioset.git
111
- ```
112
-
113
-
114
- ## Configure Qualcomm® AI Hub Workbench to run this model on a cloud-hosted device
115
-
116
- Sign-in to [Qualcomm® AI Hub Workbench](https://workbench.aihub.qualcomm.com/) with your
117
- Qualcomm® ID. Once signed in navigate to `Account -> Settings -> API Token`.
118
-
119
- With this API token, you can configure your client to run models on the cloud
120
- hosted devices.
121
- ```bash
122
- qai-hub configure --api_token API_TOKEN
123
- ```
124
- Navigate to [docs](https://workbench.aihub.qualcomm.com/docs/) for more information.
125
-
126
-
127
-
128
- ## Demo off target
129
-
130
- The package contains a simple end-to-end demo that downloads pre-trained
131
- weights and runs this model on a sample input.
132
-
133
- ```bash
134
- python -m qai_hub_models.models.yamnet.demo
135
- ```
136
-
137
- The above demo runs a reference implementation of pre-processing, model
138
- inference, and post processing.
139
-
140
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
141
- environment, please add the following to your cell (instead of the above).
142
- ```
143
- %run -m qai_hub_models.models.yamnet.demo
144
- ```
145
-
146
-
147
- ### Run model on a cloud-hosted device
148
-
149
- In addition to the demo, you can also run the model on a cloud-hosted Qualcomm®
150
- device. This script does the following:
151
- * Performance check on-device on a cloud-hosted device
152
- * Downloads compiled assets that can be deployed on-device for Android.
153
- * Accuracy check between PyTorch and on-device outputs.
154
-
155
- ```bash
156
- python -m qai_hub_models.models.yamnet.export
157
- ```
158
-
159
-
160
-
161
- ## How does this work?
162
-
163
- This [export script](https://aihub.qualcomm.com/models/yamnet/qai_hub_models/models/YamNet/export.py)
164
- leverages [Qualcomm® AI Hub](https://aihub.qualcomm.com/) to optimize, validate, and deploy this model
165
- on-device. Lets go through each step below in detail:
166
-
167
- Step 1: **Compile model for on-device deployment**
168
-
169
- To compile a PyTorch model for on-device deployment, we first trace the model
170
- in memory using the `jit.trace` and then call the `submit_compile_job` API.
171
-
172
- ```python
173
- import torch
174
-
175
- import qai_hub as hub
176
- from qai_hub_models.models.yamnet import Model
177
-
178
- # Load the model
179
- torch_model = Model.from_pretrained()
180
-
181
- # Device
182
- device = hub.Device("Samsung Galaxy S25")
183
-
184
- # Trace model
185
- input_shape = torch_model.get_input_spec()
186
- sample_inputs = torch_model.sample_inputs()
187
-
188
- pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
189
-
190
- # Compile model on a specific device
191
- compile_job = hub.submit_compile_job(
192
- model=pt_model,
193
- device=device,
194
- input_specs=torch_model.get_input_spec(),
195
- )
196
-
197
- # Get target model to run on-device
198
- target_model = compile_job.get_target_model()
199
-
200
- ```
201
-
202
-
203
- Step 2: **Performance profiling on cloud-hosted device**
204
-
205
- After compiling models from step 1. Models can be profiled model on-device using the
206
- `target_model`. Note that this scripts runs the model on a device automatically
207
- provisioned in the cloud. Once the job is submitted, you can navigate to a
208
- provided job URL to view a variety of on-device performance metrics.
209
- ```python
210
- profile_job = hub.submit_profile_job(
211
- model=target_model,
212
- device=device,
213
- )
214
-
215
- ```
216
-
217
- Step 3: **Verify on-device accuracy**
218
-
219
- To verify the accuracy of the model on-device, you can run on-device inference
220
- on sample input data on the same cloud hosted device.
221
- ```python
222
- input_data = torch_model.sample_inputs()
223
- inference_job = hub.submit_inference_job(
224
- model=target_model,
225
- device=device,
226
- inputs=input_data,
227
- )
228
- on_device_output = inference_job.download_output_data()
229
-
230
- ```
231
- With the output of the model, you can compute like PSNR, relative errors or
232
- spot check the output with expected output.
233
-
234
- **Note**: This on-device profiling and inference requires access to Qualcomm®
235
- AI Hub Workbench. [Sign up for access](https://myaccount.qualcomm.com/signup).
236
-
237
-
238
-
239
- ## Run demo on a cloud-hosted device
240
-
241
- You can also run the demo on-device.
242
-
243
- ```bash
244
- python -m qai_hub_models.models.yamnet.demo --eval-mode on-device
245
- ```
246
-
247
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
248
- environment, please add the following to your cell (instead of the above).
249
- ```
250
- %run -m qai_hub_models.models.yamnet.demo -- --eval-mode on-device
251
- ```
252
-
253
-
254
- ## Deploying compiled model to Android
255
-
256
-
257
- The models can be deployed using multiple runtimes:
258
- - TensorFlow Lite (`.tflite` export): [This
259
- tutorial](https://www.tensorflow.org/lite/android/quickstart) provides a
260
- guide to deploy the .tflite model in an Android application.
261
-
262
-
263
- - QNN (`.so` export ): This [sample
264
- app](https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-50/sample_app.html)
265
- provides instructions on how to use the `.so` shared library in an Android application.
266
-
267
-
268
- ## View on Qualcomm® AI Hub
269
- Get more details on YamNet's performance across various devices [here](https://aihub.qualcomm.com/models/yamnet).
270
- Explore all available models on [Qualcomm® AI Hub](https://aihub.qualcomm.com/)
271
-
272
 
273
  ## License
274
  * The license for the original implementation of YamNet can be found
275
  [here](https://github.com/w-hc/torch_audioset/blob/master/LICENSE).
276
 
277
-
278
-
279
  ## References
280
  * [MobileNets Efficient Convolutional Neural Networks for Mobile Vision Applications](https://arxiv.org/abs/1704.04861)
281
  * [Source Model Implementation](https://github.com/w-hc/torch_audioset)
282
 
283
-
284
-
285
  ## Community
286
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
287
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
288
-
289
-
 
10
 
11
  ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/yamnet/web-assets/model_demo.png)
12
 
13
+ # YamNet: Optimized for Qualcomm Devices
 
 
14
 
15
  An audio event classifier trained on the AudioSet dataset to predict audio events from the AudioSet ontology employing the Mobilenet_v1 depthwise-separable convolution architecture.
16
 
17
+ This is based on the implementation of YamNet found [here](https://github.com/w-hc/torch_audioset).
18
+ 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/yamnet) library to export with custom configurations. More details on model performance across various devices, can be found [here](#performance-summary).
19
+
20
+ 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.
21
+
22
+ ## Getting Started
23
+ There are two ways to deploy this model on your device:
24
+
25
+ ### Option 1: Download Pre-Exported Models
26
+
27
+ Below are pre-exported model assets ready for deployment.
28
+
29
+ | Runtime | Precision | Chipset | SDK Versions | Download |
30
+ |---|---|---|---|---|
31
+ | 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/yamnet/releases/v0.46.1/yamnet-onnx-float.zip)
32
+ | 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/yamnet/releases/v0.46.1/yamnet-onnx-w8a16.zip)
33
+ | ONNX | w8a8 | Universal | QAIRT 2.37, ONNX Runtime 1.23.0 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/yamnet/releases/v0.46.1/yamnet-onnx-w8a8.zip)
34
+ | QNN_DLC | float | Universal | QAIRT 2.42 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/yamnet/releases/v0.46.1/yamnet-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/yamnet/releases/v0.46.1/yamnet-qnn_dlc-w8a16.zip)
36
+ | QNN_DLC | w8a8 | Universal | QAIRT 2.42 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/yamnet/releases/v0.46.1/yamnet-qnn_dlc-w8a8.zip)
37
+ | 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/yamnet/releases/v0.46.1/yamnet-tflite-float.zip)
38
+ | TFLITE | w8a8 | Universal | QAIRT 2.42, TFLite 2.17.0 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/yamnet/releases/v0.46.1/yamnet-tflite-w8a8.zip)
39
+
40
+ For more device-specific assets and performance metrics, visit **[YamNet on Qualcomm® AI Hub](https://aihub.qualcomm.com/models/yamnet)**.
41
+
42
+
43
+ ### Option 2: Export with Custom Configurations
44
+
45
+ Use the [Qualcomm® AI Hub Models](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/yamnet) Python library to compile and export the model with your own:
46
+ - Custom weights (e.g., fine-tuned checkpoints)
47
+ - Custom input shapes
48
+ - Target device and runtime configurations
49
+
50
+ This option is ideal if you need to customize the model beyond the default configuration provided here.
51
+
52
+ See our repository for [YamNet on GitHub](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/yamnet) for usage instructions.
53
+
54
+ ## Model Details
55
+
56
+ **Model Type:** Model_use_case.audio_classification
57
+
58
+ **Model Stats:**
59
+ - Model checkpoint: yamnet.pth
60
+ - Input resolution: 1x1x96x64
61
+ - Number of parameters: 3.73M
62
+ - Model size (float): 14.2 MB
63
+
64
+ ## Performance Summary
65
+ | Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit
66
+ |---|---|---|---|---|---|---
67
+ | YamNet | ONNX | float | Snapdragon® X Elite | 0.286 ms | 8 - 8 MB | NPU
68
+ | YamNet | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 0.33 ms | 0 - 109 MB | NPU
69
+ | YamNet | ONNX | float | Qualcomm® QCS8550 (Proxy) | 0.367 ms | 0 - 117 MB | NPU
70
+ | YamNet | ONNX | float | Qualcomm® QCS9075 | 0.487 ms | 0 - 3 MB | NPU
71
+ | YamNet | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 0.269 ms | 0 - 92 MB | NPU
72
+ | YamNet | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.26 ms | 0 - 92 MB | NPU
73
+ | YamNet | ONNX | w8a16 | Snapdragon® X Elite | 0.21 ms | 4 - 4 MB | NPU
74
+ | YamNet | ONNX | w8a16 | Snapdragon® 8 Gen 3 Mobile | 0.265 ms | 0 - 106 MB | NPU
75
+ | YamNet | ONNX | w8a16 | Qualcomm® QCS6490 | 11.068 ms | 9 - 14 MB | CPU
76
+ | YamNet | ONNX | w8a16 | Qualcomm® QCS8550 (Proxy) | 0.317 ms | 0 - 11 MB | NPU
77
+ | YamNet | ONNX | w8a16 | Qualcomm® QCS9075 | 0.394 ms | 0 - 3 MB | NPU
78
+ | YamNet | ONNX | w8a16 | Qualcomm® QCM6690 | 6.783 ms | 6 - 13 MB | CPU
79
+ | YamNet | ONNX | w8a16 | Snapdragon® 8 Elite For Galaxy Mobile | 0.208 ms | 0 - 96 MB | NPU
80
+ | YamNet | ONNX | w8a16 | Snapdragon® 7 Gen 4 Mobile | 4.83 ms | 6 - 13 MB | CPU
81
+ | YamNet | ONNX | w8a16 | Snapdragon® 8 Elite Gen 5 Mobile | 0.204 ms | 0 - 95 MB | NPU
82
+ | YamNet | ONNX | w8a8 | Snapdragon® X Elite | 0.22 ms | 4 - 4 MB | NPU
83
+ | YamNet | ONNX | w8a8 | Snapdragon® 8 Gen 3 Mobile | 0.255 ms | 0 - 105 MB | NPU
84
+ | YamNet | ONNX | w8a8 | Qualcomm® QCS6490 | 1.655 ms | 0 - 6 MB | CPU
85
+ | YamNet | ONNX | w8a8 | Qualcomm® QCS8550 (Proxy) | 0.333 ms | 0 - 6 MB | NPU
86
+ | YamNet | ONNX | w8a8 | Qualcomm® QCS9075 | 0.393 ms | 0 - 3 MB | NPU
87
+ | YamNet | ONNX | w8a8 | Qualcomm® QCM6690 | 0.825 ms | 0 - 8 MB | CPU
88
+ | YamNet | ONNX | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 0.207 ms | 0 - 92 MB | NPU
89
+ | YamNet | ONNX | w8a8 | Snapdragon® 7 Gen 4 Mobile | 0.561 ms | 0 - 7 MB | CPU
90
+ | YamNet | ONNX | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 0.2 ms | 0 - 95 MB | NPU
91
+ | YamNet | QNN_DLC | float | Snapdragon® X Elite | 0.286 ms | 0 - 0 MB | NPU
92
+ | YamNet | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 0.181 ms | 0 - 38 MB | NPU
93
+ | YamNet | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 0.211 ms | 0 - 25 MB | NPU
94
+ | YamNet | QNN_DLC | float | Qualcomm® SA8775P | 0.36 ms | 0 - 23 MB | NPU
95
+ | YamNet | QNN_DLC | float | Qualcomm® QCS9075 | 0.259 ms | 0 - 2 MB | NPU
96
+ | YamNet | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 0.355 ms | 0 - 39 MB | NPU
97
+ | YamNet | QNN_DLC | float | Qualcomm® SA8295P | 0.556 ms | 0 - 20 MB | NPU
98
+ | YamNet | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 0.161 ms | 0 - 25 MB | NPU
99
+ | YamNet | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.15 ms | 0 - 24 MB | NPU
100
+ | YamNet | QNN_DLC | w8a16 | Snapdragon® X Elite | 0.214 ms | 0 - 0 MB | NPU
101
+ | YamNet | QNN_DLC | w8a16 | Snapdragon® 8 Gen 3 Mobile | 0.116 ms | 0 - 35 MB | NPU
102
+ | YamNet | QNN_DLC | w8a16 | Qualcomm® QCS6490 | 0.631 ms | 0 - 2 MB | NPU
103
+ | YamNet | QNN_DLC | w8a16 | Qualcomm® QCS8275 (Proxy) | 0.421 ms | 0 - 23 MB | NPU
104
+ | YamNet | QNN_DLC | w8a16 | Qualcomm® QCS8550 (Proxy) | 0.136 ms | 0 - 1 MB | NPU
105
+ | YamNet | QNN_DLC | w8a16 | Qualcomm® SA8775P | 0.268 ms | 0 - 25 MB | NPU
106
+ | YamNet | QNN_DLC | w8a16 | Qualcomm® QCS9075 | 0.184 ms | 0 - 2 MB | NPU
107
+ | YamNet | QNN_DLC | w8a16 | Qualcomm® QCM6690 | 0.502 ms | 0 - 22 MB | NPU
108
+ | YamNet | QNN_DLC | w8a16 | Qualcomm® QCS8450 (Proxy) | 0.214 ms | 0 - 36 MB | NPU
109
+ | YamNet | QNN_DLC | w8a16 | Qualcomm® SA7255P | 0.421 ms | 0 - 23 MB | NPU
110
+ | YamNet | QNN_DLC | w8a16 | Qualcomm® SA8295P | 0.428 ms | 0 - 21 MB | NPU
111
+ | YamNet | QNN_DLC | w8a16 | Snapdragon® 8 Elite For Galaxy Mobile | 0.094 ms | 0 - 21 MB | NPU
112
+ | YamNet | QNN_DLC | w8a16 | Snapdragon® 7 Gen 4 Mobile | 0.171 ms | 0 - 22 MB | NPU
113
+ | YamNet | QNN_DLC | w8a16 | Snapdragon® 8 Elite Gen 5 Mobile | 0.098 ms | 0 - 25 MB | NPU
114
+ | YamNet | QNN_DLC | w8a8 | Snapdragon® X Elite | 0.202 ms | 0 - 0 MB | NPU
115
+ | YamNet | QNN_DLC | w8a8 | Snapdragon® 8 Gen 3 Mobile | 0.11 ms | 0 - 35 MB | NPU
116
+ | YamNet | QNN_DLC | w8a8 | Qualcomm® QCS6490 | 0.624 ms | 0 - 2 MB | NPU
117
+ | YamNet | QNN_DLC | w8a8 | Qualcomm® QCS8275 (Proxy) | 0.392 ms | 0 - 24 MB | NPU
118
+ | YamNet | QNN_DLC | w8a8 | Qualcomm® QCS8550 (Proxy) | 0.131 ms | 0 - 1 MB | NPU
119
+ | YamNet | QNN_DLC | w8a8 | Qualcomm® SA8775P | 0.273 ms | 0 - 24 MB | NPU
120
+ | YamNet | QNN_DLC | w8a8 | Qualcomm® QCS9075 | 0.183 ms | 0 - 2 MB | NPU
121
+ | YamNet | QNN_DLC | w8a8 | Qualcomm® QCM6690 | 0.434 ms | 0 - 22 MB | NPU
122
+ | YamNet | QNN_DLC | w8a8 | Qualcomm® QCS8450 (Proxy) | 0.205 ms | 0 - 36 MB | NPU
123
+ | YamNet | QNN_DLC | w8a8 | Qualcomm® SA7255P | 0.392 ms | 0 - 24 MB | NPU
124
+ | YamNet | QNN_DLC | w8a8 | Qualcomm® SA8295P | 0.443 ms | 0 - 21 MB | NPU
125
+ | YamNet | QNN_DLC | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 0.094 ms | 0 - 25 MB | NPU
126
+ | YamNet | QNN_DLC | w8a8 | Snapdragon® 7 Gen 4 Mobile | 0.164 ms | 0 - 22 MB | NPU
127
+ | YamNet | QNN_DLC | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 0.089 ms | 0 - 25 MB | NPU
128
+ | YamNet | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 0.181 ms | 0 - 44 MB | NPU
129
+ | YamNet | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 1.962 ms | 0 - 20 MB | GPU
130
+ | YamNet | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 0.221 ms | 0 - 1 MB | NPU
131
+ | YamNet | TFLITE | float | Qualcomm® SA8775P | 0.368 ms | 0 - 31 MB | NPU
132
+ | YamNet | TFLITE | float | Qualcomm® QCS9075 | 0.261 ms | 0 - 10 MB | NPU
133
+ | YamNet | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 0.355 ms | 0 - 45 MB | NPU
134
+ | YamNet | TFLITE | float | Qualcomm® SA7255P | 1.962 ms | 0 - 20 MB | GPU
135
+ | YamNet | TFLITE | float | Qualcomm® SA8295P | 0.561 ms | 0 - 27 MB | NPU
136
+ | YamNet | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 0.159 ms | 0 - 32 MB | NPU
137
+ | YamNet | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 0.146 ms | 0 - 30 MB | NPU
138
+ | YamNet | TFLITE | w8a8 | Snapdragon® 8 Gen 3 Mobile | 0.109 ms | 0 - 35 MB | NPU
139
+ | YamNet | TFLITE | w8a8 | Qualcomm® QCS6490 | 0.51 ms | 0 - 6 MB | NPU
140
+ | YamNet | TFLITE | w8a8 | Qualcomm® QCS8275 (Proxy) | 0.418 ms | 0 - 23 MB | NPU
141
+ | YamNet | TFLITE | w8a8 | Qualcomm® QCS8550 (Proxy) | 0.131 ms | 0 - 7 MB | NPU
142
+ | YamNet | TFLITE | w8a8 | Qualcomm® SA8775P | 0.784 ms | 0 - 24 MB | NPU
143
+ | YamNet | TFLITE | w8a8 | Qualcomm® QCS9075 | 0.182 ms | 0 - 6 MB | NPU
144
+ | YamNet | TFLITE | w8a8 | Qualcomm® QCM6690 | 0.426 ms | 0 - 21 MB | NPU
145
+ | YamNet | TFLITE | w8a8 | Qualcomm® QCS8450 (Proxy) | 0.208 ms | 0 - 37 MB | NPU
146
+ | YamNet | TFLITE | w8a8 | Qualcomm® SA7255P | 0.418 ms | 0 - 23 MB | NPU
147
+ | YamNet | TFLITE | w8a8 | Qualcomm® SA8295P | 0.434 ms | 0 - 20 MB | NPU
148
+ | YamNet | TFLITE | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 0.101 ms | 0 - 26 MB | NPU
149
+ | YamNet | TFLITE | w8a8 | Snapdragon® 7 Gen 4 Mobile | 0.169 ms | 0 - 21 MB | NPU
150
+ | YamNet | TFLITE | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 0.095 ms | 0 - 24 MB | NPU
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
 
152
  ## License
153
  * The license for the original implementation of YamNet can be found
154
  [here](https://github.com/w-hc/torch_audioset/blob/master/LICENSE).
155
 
 
 
156
  ## References
157
  * [MobileNets Efficient Convolutional Neural Networks for Mobile Vision Applications](https://arxiv.org/abs/1704.04861)
158
  * [Source Model Implementation](https://github.com/w-hc/torch_audioset)
159
 
 
 
160
  ## Community
161
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
162
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
 
 
YamNet_float.dlc DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:22f7a1218cea50cfcb9605496c12847c9ac7bc464c005d2b3e3a720eae646a3f
3
- size 14997292
 
 
 
 
YamNet_float.onnx.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:eff9769ddc77bba73616342d2416e7e035998b606e25060ae2a805885199e65d
3
- size 13923895
 
 
 
 
YamNet_float.tflite DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:ef906bcd1b4671eda849a3d7dbe183e72c502470c0f1fd36f5c85b9d8bfc22aa
3
- size 14930120
 
 
 
 
YamNet_w8a8.dlc DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:0c07f61b8969a0b821443756a501bf7557c463d6a291e4cca0fcf4e7387fd640
3
- size 4459124
 
 
 
 
YamNet_w8a8.onnx.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:c8c7b21211961bd10679ae2a2d740ad05132bf084abdb4ccc8a8d8b1cc718c0e
3
- size 7097042
 
 
 
 
YamNet_w8a8.tflite DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:eeac04ebe1e8f153852b197e0908207ee3e2a08c3f515334fc420eff68cf2d97
3
- size 4043696
 
 
 
 
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