qaihm-bot commited on
Commit
36ff84e
·
verified ·
1 Parent(s): 882f497

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

PidNet_float.dlc DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:74ac78e63750a1641ce90179b221df5a8dc626c6553be02fda93944f5328b9e0
3
- size 30689364
 
 
 
 
PidNet_float.onnx.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:95b84688e45e7e059dc8ae8573aa0f260916e4b9bd3bcc3711200992346d9414
3
- size 28460856
 
 
 
 
PidNet_float.tflite DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:f38a2ca29f121029242446abf6c9f62ceac476bf65a34eca42fabafd7dc81e64
3
- size 30520480
 
 
 
 
PidNet_w8a8.dlc DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:5b60afb731452762989fa8d4b364084979872d42cc56122dcded82da6a8d9a96
3
- size 8408052
 
 
 
 
PidNet_w8a8.onnx.zip DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:f86a25708d2fd1e7eaebf4c853b699007cf2cb3922cae0b24260b9856bdef69b
3
- size 13929286
 
 
 
 
PidNet_w8a8.tflite DELETED
@@ -1,3 +0,0 @@
1
- version https://git-lfs.github.com/spec/v1
2
- oid sha256:2ea10427f2a7dc1a2e2faacbf5d21f5b8ed46645dde3547cbac4620ff5fb5fdc
3
- size 8405328
 
 
 
 
README.md CHANGED
@@ -10,279 +10,130 @@ pipeline_tag: image-segmentation
10
 
11
  ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/pidnet/web-assets/model_demo.png)
12
 
13
- # PidNet: Optimized for Mobile Deployment
14
- ## Segment images or video by class in real-time on device
15
-
16
 
17
  PIDNet (Proportional-Integral-Derivative Network) is a real-time semantic segmentation model based on PID controllers
18
 
19
- This model is an implementation of PidNet found [here](https://github.com/XuJiacong/PIDNet).
20
-
21
-
22
- This repository provides scripts to run PidNet on Qualcomm® devices.
23
- More details on model performance across various devices, can be found
24
- [here](https://aihub.qualcomm.com/models/pidnet).
25
-
26
-
27
-
28
- ### Model Details
29
-
30
- - **Model Type:** Model_use_case.semantic_segmentation
31
- - **Model Stats:**
32
- - Model checkpoint: PIDNet_S_Cityscapes_val.pt
33
- - Inference latency: RealTime
34
- - Input resolution: 1024x2048
35
- - Number of output classes: 19
36
- - Number of parameters: 8.06M
37
- - Model size (float): 29.1 MB
38
- - Model size (w8a8): 8.02 MB
39
-
40
- | Model | Precision | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit | Target Model
41
- |---|---|---|---|---|---|---|---|---|
42
- | PidNet | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 115.583 ms | 0 - 194 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.tflite) |
43
- | PidNet | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | QNN_DLC | 115.619 ms | 21 - 207 MB | NPU | [PidNet.dlc](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.dlc) |
44
- | PidNet | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 69.254 ms | 2 - 305 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.tflite) |
45
- | PidNet | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | QNN_DLC | 68.751 ms | 21 - 314 MB | NPU | [PidNet.dlc](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.dlc) |
46
- | PidNet | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 35.818 ms | 2 - 5 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.tflite) |
47
- | PidNet | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | QNN_DLC | 35.971 ms | 24 - 26 MB | NPU | [PidNet.dlc](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.dlc) |
48
- | PidNet | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | ONNX | 29.876 ms | 24 - 47 MB | NPU | [PidNet.onnx.zip](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.onnx.zip) |
49
- | PidNet | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 201.947 ms | 0 - 195 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.tflite) |
50
- | PidNet | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | QNN_DLC | 44.451 ms | 24 - 209 MB | NPU | [PidNet.dlc](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.dlc) |
51
- | PidNet | float | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 115.583 ms | 0 - 194 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.tflite) |
52
- | PidNet | float | SA7255P ADP | Qualcomm® SA7255P | QNN_DLC | 115.619 ms | 21 - 207 MB | NPU | [PidNet.dlc](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.dlc) |
53
- | PidNet | float | SA8295P ADP | Qualcomm® SA8295P | TFLITE | 50.417 ms | 2 - 208 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.tflite) |
54
- | PidNet | float | SA8295P ADP | Qualcomm® SA8295P | QNN_DLC | 50.403 ms | 24 - 222 MB | NPU | [PidNet.dlc](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.dlc) |
55
- | PidNet | float | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 201.947 ms | 0 - 195 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.tflite) |
56
- | PidNet | float | SA8775P ADP | Qualcomm® SA8775P | QNN_DLC | 44.451 ms | 24 - 209 MB | NPU | [PidNet.dlc](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.dlc) |
57
- | PidNet | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 24.276 ms | 1 - 301 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.tflite) |
58
- | PidNet | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | QNN_DLC | 24.351 ms | 24 - 307 MB | NPU | [PidNet.dlc](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.dlc) |
59
- | PidNet | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 19.345 ms | 31 - 282 MB | NPU | [PidNet.onnx.zip](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.onnx.zip) |
60
- | PidNet | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | TFLITE | 18.53 ms | 2 - 211 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.tflite) |
61
- | PidNet | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | QNN_DLC | 18.553 ms | 22 - 228 MB | NPU | [PidNet.dlc](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.dlc) |
62
- | PidNet | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | ONNX | 16.225 ms | 7 - 168 MB | NPU | [PidNet.onnx.zip](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.onnx.zip) |
63
- | PidNet | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | TFLITE | 13.623 ms | 2 - 229 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.tflite) |
64
- | PidNet | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | QNN_DLC | 13.814 ms | 24 - 247 MB | NPU | [PidNet.dlc](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.dlc) |
65
- | PidNet | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | ONNX | 11.491 ms | 30 - 248 MB | NPU | [PidNet.onnx.zip](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.onnx.zip) |
66
- | PidNet | float | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN_DLC | 36.89 ms | 24 - 24 MB | NPU | [PidNet.dlc](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.dlc) |
67
- | PidNet | float | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 29.757 ms | 24 - 24 MB | NPU | [PidNet.onnx.zip](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet.onnx.zip) |
68
- | PidNet | w8a8 | Dragonwing Q-6690 MTP | Qualcomm® QCM6690 | TFLITE | 220.377 ms | 2 - 172 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.tflite) |
69
- | PidNet | w8a8 | Dragonwing Q-6690 MTP | Qualcomm® QCM6690 | ONNX | 352.863 ms | 178 - 195 MB | CPU | [PidNet.onnx.zip](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.onnx.zip) |
70
- | PidNet | w8a8 | Dragonwing RB3 Gen 2 Vision Kit | Qualcomm® QCS6490 | TFLITE | 184.205 ms | 2 - 72 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.tflite) |
71
- | PidNet | w8a8 | Dragonwing RB3 Gen 2 Vision Kit | Qualcomm® QCS6490 | ONNX | 391.806 ms | 195 - 216 MB | CPU | [PidNet.onnx.zip](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.onnx.zip) |
72
- | PidNet | w8a8 | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 132.43 ms | 1 - 180 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.tflite) |
73
- | PidNet | w8a8 | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | QNN_DLC | 125.083 ms | 6 - 186 MB | NPU | [PidNet.dlc](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.dlc) |
74
- | PidNet | w8a8 | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 74.938 ms | 1 - 235 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.tflite) |
75
- | PidNet | w8a8 | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | QNN_DLC | 77.218 ms | 6 - 240 MB | NPU | [PidNet.dlc](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.dlc) |
76
- | PidNet | w8a8 | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 52.739 ms | 1 - 3 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.tflite) |
77
- | PidNet | w8a8 | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | QNN_DLC | 64.927 ms | 6 - 8 MB | NPU | [PidNet.dlc](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.dlc) |
78
- | PidNet | w8a8 | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | ONNX | 60.761 ms | 99 - 101 MB | NPU | [PidNet.onnx.zip](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.onnx.zip) |
79
- | PidNet | w8a8 | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 53.578 ms | 1 - 180 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.tflite) |
80
- | PidNet | w8a8 | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | QNN_DLC | 65.762 ms | 6 - 186 MB | NPU | [PidNet.dlc](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.dlc) |
81
- | PidNet | w8a8 | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 132.43 ms | 1 - 180 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.tflite) |
82
- | PidNet | w8a8 | SA7255P ADP | Qualcomm® SA7255P | QNN_DLC | 125.083 ms | 6 - 186 MB | NPU | [PidNet.dlc](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.dlc) |
83
- | PidNet | w8a8 | SA8295P ADP | Qualcomm® SA8295P | TFLITE | 76.863 ms | 1 - 183 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.tflite) |
84
- | PidNet | w8a8 | SA8295P ADP | Qualcomm® SA8295P | QNN_DLC | 73.627 ms | 6 - 188 MB | NPU | [PidNet.dlc](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.dlc) |
85
- | PidNet | w8a8 | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 53.578 ms | 1 - 180 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.tflite) |
86
- | PidNet | w8a8 | SA8775P ADP | Qualcomm® SA8775P | QNN_DLC | 65.762 ms | 6 - 186 MB | NPU | [PidNet.dlc](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.dlc) |
87
- | PidNet | w8a8 | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 51.133 ms | 1 - 238 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.tflite) |
88
- | PidNet | w8a8 | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | QNN_DLC | 48.374 ms | 6 - 239 MB | NPU | [PidNet.dlc](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.dlc) |
89
- | PidNet | w8a8 | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 46.624 ms | 105 - 315 MB | NPU | [PidNet.onnx.zip](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.onnx.zip) |
90
- | PidNet | w8a8 | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | TFLITE | 37.933 ms | 1 - 197 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.tflite) |
91
- | PidNet | w8a8 | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | QNN_DLC | 41.018 ms | 6 - 204 MB | NPU | [PidNet.dlc](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.dlc) |
92
- | PidNet | w8a8 | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | ONNX | 42.002 ms | 98 - 254 MB | NPU | [PidNet.onnx.zip](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.onnx.zip) |
93
- | PidNet | w8a8 | Snapdragon 7 Gen 4 QRD | Snapdragon® 7 Gen 4 Mobile | TFLITE | 86.82 ms | 2 - 192 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.tflite) |
94
- | PidNet | w8a8 | Snapdragon 7 Gen 4 QRD | Snapdragon® 7 Gen 4 Mobile | ONNX | 327.892 ms | 190 - 207 MB | CPU | [PidNet.onnx.zip](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.onnx.zip) |
95
- | PidNet | w8a8 | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | TFLITE | 36.7 ms | 3 - 224 MB | NPU | [PidNet.tflite](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.tflite) |
96
- | PidNet | w8a8 | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | QNN_DLC | 43.109 ms | 6 - 226 MB | NPU | [PidNet.dlc](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.dlc) |
97
- | PidNet | w8a8 | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | ONNX | 40.896 ms | 106 - 271 MB | NPU | [PidNet.onnx.zip](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.onnx.zip) |
98
- | PidNet | w8a8 | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN_DLC | 68.011 ms | 6 - 6 MB | NPU | [PidNet.dlc](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.dlc) |
99
- | PidNet | w8a8 | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 62.67 ms | 131 - 131 MB | NPU | [PidNet.onnx.zip](https://huggingface.co/qualcomm/PidNet/blob/main/PidNet_w8a8.onnx.zip) |
100
-
101
-
102
-
103
-
104
- ## Installation
105
-
106
-
107
- Install the package via pip:
108
- ```bash
109
- pip install qai-hub-models
110
- ```
111
-
112
-
113
- ## Configure Qualcomm® AI Hub Workbench to run this model on a cloud-hosted device
114
-
115
- Sign-in to [Qualcomm® AI Hub Workbench](https://workbench.aihub.qualcomm.com/) with your
116
- Qualcomm® ID. Once signed in navigate to `Account -> Settings -> API Token`.
117
-
118
- With this API token, you can configure your client to run models on the cloud
119
- hosted devices.
120
- ```bash
121
- qai-hub configure --api_token API_TOKEN
122
- ```
123
- Navigate to [docs](https://workbench.aihub.qualcomm.com/docs/) for more information.
124
-
125
-
126
-
127
- ## Demo off target
128
-
129
- The package contains a simple end-to-end demo that downloads pre-trained
130
- weights and runs this model on a sample input.
131
-
132
- ```bash
133
- python -m qai_hub_models.models.pidnet.demo
134
- ```
135
-
136
- The above demo runs a reference implementation of pre-processing, model
137
- inference, and post processing.
138
-
139
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
140
- environment, please add the following to your cell (instead of the above).
141
- ```
142
- %run -m qai_hub_models.models.pidnet.demo
143
- ```
144
-
145
-
146
- ### Run model on a cloud-hosted device
147
-
148
- In addition to the demo, you can also run the model on a cloud-hosted Qualcomm®
149
- device. This script does the following:
150
- * Performance check on-device on a cloud-hosted device
151
- * Downloads compiled assets that can be deployed on-device for Android.
152
- * Accuracy check between PyTorch and on-device outputs.
153
-
154
- ```bash
155
- python -m qai_hub_models.models.pidnet.export
156
- ```
157
-
158
-
159
-
160
- ## How does this work?
161
-
162
- This [export script](https://aihub.qualcomm.com/models/pidnet/qai_hub_models/models/PidNet/export.py)
163
- leverages [Qualcomm® AI Hub](https://aihub.qualcomm.com/) to optimize, validate, and deploy this model
164
- on-device. Lets go through each step below in detail:
165
-
166
- Step 1: **Compile model for on-device deployment**
167
-
168
- To compile a PyTorch model for on-device deployment, we first trace the model
169
- in memory using the `jit.trace` and then call the `submit_compile_job` API.
170
-
171
- ```python
172
- import torch
173
-
174
- import qai_hub as hub
175
- from qai_hub_models.models.pidnet import Model
176
-
177
- # Load the model
178
- torch_model = Model.from_pretrained()
179
-
180
- # Device
181
- device = hub.Device("Samsung Galaxy S25")
182
-
183
- # Trace model
184
- input_shape = torch_model.get_input_spec()
185
- sample_inputs = torch_model.sample_inputs()
186
-
187
- pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
188
-
189
- # Compile model on a specific device
190
- compile_job = hub.submit_compile_job(
191
- model=pt_model,
192
- device=device,
193
- input_specs=torch_model.get_input_spec(),
194
- )
195
-
196
- # Get target model to run on-device
197
- target_model = compile_job.get_target_model()
198
-
199
- ```
200
-
201
-
202
- Step 2: **Performance profiling on cloud-hosted device**
203
-
204
- After compiling models from step 1. Models can be profiled model on-device using the
205
- `target_model`. Note that this scripts runs the model on a device automatically
206
- provisioned in the cloud. Once the job is submitted, you can navigate to a
207
- provided job URL to view a variety of on-device performance metrics.
208
- ```python
209
- profile_job = hub.submit_profile_job(
210
- model=target_model,
211
- device=device,
212
- )
213
-
214
- ```
215
-
216
- Step 3: **Verify on-device accuracy**
217
-
218
- To verify the accuracy of the model on-device, you can run on-device inference
219
- on sample input data on the same cloud hosted device.
220
- ```python
221
- input_data = torch_model.sample_inputs()
222
- inference_job = hub.submit_inference_job(
223
- model=target_model,
224
- device=device,
225
- inputs=input_data,
226
- )
227
- on_device_output = inference_job.download_output_data()
228
-
229
- ```
230
- With the output of the model, you can compute like PSNR, relative errors or
231
- spot check the output with expected output.
232
-
233
- **Note**: This on-device profiling and inference requires access to Qualcomm®
234
- AI Hub Workbench. [Sign up for access](https://myaccount.qualcomm.com/signup).
235
-
236
-
237
-
238
- ## Run demo on a cloud-hosted device
239
-
240
- You can also run the demo on-device.
241
-
242
- ```bash
243
- python -m qai_hub_models.models.pidnet.demo --eval-mode on-device
244
- ```
245
-
246
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
247
- environment, please add the following to your cell (instead of the above).
248
- ```
249
- %run -m qai_hub_models.models.pidnet.demo -- --eval-mode on-device
250
- ```
251
-
252
-
253
- ## Deploying compiled model to Android
254
-
255
-
256
- The models can be deployed using multiple runtimes:
257
- - TensorFlow Lite (`.tflite` export): [This
258
- tutorial](https://www.tensorflow.org/lite/android/quickstart) provides a
259
- guide to deploy the .tflite model in an Android application.
260
-
261
-
262
- - QNN (`.so` export ): This [sample
263
- app](https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-50/sample_app.html)
264
- provides instructions on how to use the `.so` shared library in an Android application.
265
-
266
-
267
- ## View on Qualcomm® AI Hub
268
- Get more details on PidNet's performance across various devices [here](https://aihub.qualcomm.com/models/pidnet).
269
- Explore all available models on [Qualcomm® AI Hub](https://aihub.qualcomm.com/)
270
-
271
 
272
  ## License
273
  * The license for the original implementation of PidNet can be found
274
  [here](https://github.com/XuJiacong/PIDNet/blob/main/LICENSE).
275
 
276
-
277
-
278
  ## References
279
  * [PIDNet A Real-time Semantic Segmentation Network Inspired from PID Controller Segmentation of Road Scenes](https://arxiv.org/abs/2206.02066)
280
  * [Source Model Implementation](https://github.com/XuJiacong/PIDNet)
281
 
282
-
283
-
284
  ## Community
285
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
286
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
287
-
288
-
 
10
 
11
  ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/pidnet/web-assets/model_demo.png)
12
 
13
+ # PidNet: Optimized for Qualcomm Devices
 
 
14
 
15
  PIDNet (Proportional-Integral-Derivative Network) is a real-time semantic segmentation model based on PID controllers
16
 
17
+ This is based on the implementation of PidNet found [here](https://github.com/XuJiacong/PIDNet).
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/pidnet) 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/pidnet/releases/v0.46.1/pidnet-onnx-float.zip)
32
+ | 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/pidnet/releases/v0.46.1/pidnet-onnx-w8a8.zip)
33
+ | QNN_DLC | float | Universal | QAIRT 2.42 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/pidnet/releases/v0.46.1/pidnet-qnn_dlc-float.zip)
34
+ | QNN_DLC | w8a8 | Universal | QAIRT 2.42 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/pidnet/releases/v0.46.1/pidnet-qnn_dlc-w8a8.zip)
35
+ | 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/pidnet/releases/v0.46.1/pidnet-tflite-float.zip)
36
+ | 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/pidnet/releases/v0.46.1/pidnet-tflite-w8a8.zip)
37
+
38
+ For more device-specific assets and performance metrics, visit **[PidNet on Qualcomm® AI Hub](https://aihub.qualcomm.com/models/pidnet)**.
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/pidnet) 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 [PidNet on GitHub](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/pidnet) for usage instructions.
51
+
52
+ ## Model Details
53
+
54
+ **Model Type:** Model_use_case.semantic_segmentation
55
+
56
+ **Model Stats:**
57
+ - Model checkpoint: PIDNet_S_Cityscapes_val.pt
58
+ - Inference latency: RealTime
59
+ - Input resolution: 1024x2048
60
+ - Number of output classes: 19
61
+ - Number of parameters: 8.06M
62
+ - Model size (float): 29.1 MB
63
+ - Model size (w8a8): 8.02 MB
64
+
65
+ ## Performance Summary
66
+ | Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit
67
+ |---|---|---|---|---|---|---
68
+ | PidNet | ONNX | float | Snapdragon® X Elite | 29.672 ms | 24 - 24 MB | NPU
69
+ | PidNet | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 20.062 ms | 30 - 283 MB | NPU
70
+ | PidNet | ONNX | float | Qualcomm® QCS8550 (Proxy) | 29.443 ms | 24 - 47 MB | NPU
71
+ | PidNet | ONNX | float | Qualcomm® QCS9075 | 46.981 ms | 24 - 50 MB | NPU
72
+ | PidNet | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 16.219 ms | 6 - 170 MB | NPU
73
+ | PidNet | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 11.504 ms | 10 - 230 MB | NPU
74
+ | PidNet | ONNX | w8a8 | Snapdragon® X Elite | 62.888 ms | 131 - 131 MB | NPU
75
+ | PidNet | ONNX | w8a8 | Snapdragon® 8 Gen 3 Mobile | 47.162 ms | 104 - 316 MB | NPU
76
+ | PidNet | ONNX | w8a8 | Qualcomm® QCS6490 | 396.442 ms | 197 - 217 MB | CPU
77
+ | PidNet | ONNX | w8a8 | Qualcomm® QCS8550 (Proxy) | 61.97 ms | 99 - 102 MB | NPU
78
+ | PidNet | ONNX | w8a8 | Qualcomm® QCS9075 | 66.445 ms | 100 - 102 MB | NPU
79
+ | PidNet | ONNX | w8a8 | Qualcomm® QCM6690 | 352.536 ms | 198 - 207 MB | CPU
80
+ | PidNet | ONNX | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 41.36 ms | 100 - 258 MB | NPU
81
+ | PidNet | ONNX | w8a8 | Snapdragon® 7 Gen 4 Mobile | 328.507 ms | 182 - 192 MB | CPU
82
+ | PidNet | ONNX | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 41.2 ms | 96 - 263 MB | NPU
83
+ | PidNet | QNN_DLC | float | Snapdragon® X Elite | 40.667 ms | 24 - 24 MB | NPU
84
+ | PidNet | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 26.571 ms | 24 - 340 MB | NPU
85
+ | PidNet | QNN_DLC | float | Qualcomm® QCS8275 (Proxy) | 120.917 ms | 24 - 243 MB | NPU
86
+ | PidNet | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 39.47 ms | 24 - 26 MB | NPU
87
+ | PidNet | QNN_DLC | float | Qualcomm® SA8775P | 48.183 ms | 24 - 244 MB | NPU
88
+ | PidNet | QNN_DLC | float | Qualcomm® QCS9075 | 61.963 ms | 24 - 52 MB | NPU
89
+ | PidNet | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 77.089 ms | 5 - 336 MB | NPU
90
+ | PidNet | QNN_DLC | float | Qualcomm® SA7255P | 120.917 ms | 24 - 243 MB | NPU
91
+ | PidNet | QNN_DLC | float | Qualcomm® SA8295P | 53.509 ms | 24 - 261 MB | NPU
92
+ | PidNet | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 19.353 ms | 15 - 261 MB | NPU
93
+ | PidNet | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 12.477 ms | 24 - 296 MB | NPU
94
+ | PidNet | QNN_DLC | w8a8 | Snapdragon® X Elite | 60.343 ms | 6 - 6 MB | NPU
95
+ | PidNet | QNN_DLC | w8a8 | Snapdragon® 8 Gen 3 Mobile | 43.386 ms | 6 - 271 MB | NPU
96
+ | PidNet | QNN_DLC | w8a8 | Qualcomm® QCS8275 (Proxy) | 111.352 ms | 6 - 217 MB | NPU
97
+ | PidNet | QNN_DLC | w8a8 | Qualcomm® QCS8550 (Proxy) | 57.922 ms | 6 - 8 MB | NPU
98
+ | PidNet | QNN_DLC | w8a8 | Qualcomm® SA8775P | 58.439 ms | 6 - 218 MB | NPU
99
+ | PidNet | QNN_DLC | w8a8 | Qualcomm® QCS9075 | 61.043 ms | 6 - 14 MB | NPU
100
+ | PidNet | QNN_DLC | w8a8 | Qualcomm® QCS8450 (Proxy) | 63.916 ms | 6 - 270 MB | NPU
101
+ | PidNet | QNN_DLC | w8a8 | Qualcomm® SA7255P | 111.352 ms | 6 - 217 MB | NPU
102
+ | PidNet | QNN_DLC | w8a8 | Qualcomm® SA8295P | 66.554 ms | 6 - 220 MB | NPU
103
+ | PidNet | QNN_DLC | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 41.33 ms | 6 - 240 MB | NPU
104
+ | PidNet | QNN_DLC | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 47.407 ms | 6 - 271 MB | NPU
105
+ | PidNet | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 27.003 ms | 1 - 337 MB | NPU
106
+ | PidNet | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 121.07 ms | 3 - 232 MB | NPU
107
+ | PidNet | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 39.328 ms | 2 - 5 MB | NPU
108
+ | PidNet | TFLITE | float | Qualcomm® SA8775P | 48.171 ms | 0 - 231 MB | NPU
109
+ | PidNet | TFLITE | float | Qualcomm® QCS9075 | 61.649 ms | 0 - 45 MB | NPU
110
+ | PidNet | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 76.087 ms | 3 - 346 MB | NPU
111
+ | PidNet | TFLITE | float | Qualcomm® SA7255P | 121.07 ms | 3 - 232 MB | NPU
112
+ | PidNet | TFLITE | float | Qualcomm® SA8295P | 53.491 ms | 2 - 244 MB | NPU
113
+ | PidNet | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 19.33 ms | 1 - 255 MB | NPU
114
+ | PidNet | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 12.463 ms | 2 - 282 MB | NPU
115
+ | PidNet | TFLITE | w8a8 | Snapdragon® 8 Gen 3 Mobile | 38.156 ms | 1 - 269 MB | NPU
116
+ | PidNet | TFLITE | w8a8 | Qualcomm® QCS6490 | 206.238 ms | 3 - 72 MB | NPU
117
+ | PidNet | TFLITE | w8a8 | Qualcomm® QCS8275 (Proxy) | 98.717 ms | 1 - 213 MB | NPU
118
+ | PidNet | TFLITE | w8a8 | Qualcomm® QCS8550 (Proxy) | 50.434 ms | 0 - 2 MB | NPU
119
+ | PidNet | TFLITE | w8a8 | Qualcomm® SA8775P | 51.134 ms | 1 - 213 MB | NPU
120
+ | PidNet | TFLITE | w8a8 | Qualcomm® QCS9075 | 53.258 ms | 0 - 16 MB | NPU
121
+ | PidNet | TFLITE | w8a8 | Qualcomm® QCM6690 | 223.507 ms | 2 - 233 MB | NPU
122
+ | PidNet | TFLITE | w8a8 | Qualcomm® QCS8450 (Proxy) | 58.793 ms | 1 - 270 MB | NPU
123
+ | PidNet | TFLITE | w8a8 | Qualcomm® SA7255P | 98.717 ms | 1 - 213 MB | NPU
124
+ | PidNet | TFLITE | w8a8 | Qualcomm® SA8295P | 58.192 ms | 0 - 215 MB | NPU
125
+ | PidNet | TFLITE | w8a8 | Snapdragon® 8 Elite For Galaxy Mobile | 38.304 ms | 1 - 233 MB | NPU
126
+ | PidNet | TFLITE | w8a8 | Snapdragon® 7 Gen 4 Mobile | 77.878 ms | 1 - 221 MB | NPU
127
+ | PidNet | TFLITE | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 45.649 ms | 0 - 263 MB | NPU
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
128
 
129
  ## License
130
  * The license for the original implementation of PidNet can be found
131
  [here](https://github.com/XuJiacong/PIDNet/blob/main/LICENSE).
132
 
 
 
133
  ## References
134
  * [PIDNet A Real-time Semantic Segmentation Network Inspired from PID Controller Segmentation of Road Scenes](https://arxiv.org/abs/2206.02066)
135
  * [Source Model Implementation](https://github.com/XuJiacong/PIDNet)
136
 
 
 
137
  ## Community
138
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
139
  * 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