qaihm-bot commited on
Commit
7d0407d
·
verified ·
1 Parent(s): 68d6a51

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

Files changed (1) hide show
  1. README.md +195 -42
README.md CHANGED
@@ -19,7 +19,11 @@ Ultralytics YOLOv11 is a machine learning model that predicts bounding boxes, se
19
  This model is an implementation of YOLOv11-Segmentation found [here](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/models/yolo/segment).
20
 
21
 
22
- More details on model performance across various devices, can be found [here](https://aihub.qualcomm.com/models/yolov11_seg).
 
 
 
 
23
 
24
  ### Model Details
25
 
@@ -34,39 +38,207 @@ This model is an implementation of YOLOv11-Segmentation found [here](https://git
34
 
35
  | Model | Precision | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit | Target Model
36
  |---|---|---|---|---|---|---|---|---|
37
- | YOLOv11-Segmentation | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 20.984 ms | 4 - 66 MB | NPU | -- |
38
  | YOLOv11-Segmentation | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | QNN_DLC | 16.17 ms | 1 - 114 MB | NPU | -- |
39
- | YOLOv11-Segmentation | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 12.435 ms | 4 - 45 MB | NPU | -- |
40
- | YOLOv11-Segmentation | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 8.577 ms | 4 - 30 MB | NPU | -- |
41
  | YOLOv11-Segmentation | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | QNN_DLC | 4.781 ms | 5 - 33 MB | NPU | -- |
42
- | YOLOv11-Segmentation | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 10.54 ms | 4 - 65 MB | NPU | -- |
43
  | YOLOv11-Segmentation | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | QNN_DLC | 6.419 ms | 0 - 113 MB | NPU | -- |
44
- | YOLOv11-Segmentation | float | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 20.984 ms | 4 - 66 MB | NPU | -- |
45
  | YOLOv11-Segmentation | float | SA7255P ADP | Qualcomm® SA7255P | QNN_DLC | 16.17 ms | 1 - 114 MB | NPU | -- |
46
- | YOLOv11-Segmentation | float | SA8255 (Proxy) | Qualcomm® SA8255P (Proxy) | TFLITE | 8.72 ms | 4 - 28 MB | NPU | -- |
47
  | YOLOv11-Segmentation | float | SA8255 (Proxy) | Qualcomm® SA8255P (Proxy) | QNN_DLC | 4.742 ms | 5 - 25 MB | NPU | -- |
48
- | YOLOv11-Segmentation | float | SA8295P ADP | Qualcomm® SA8295P | TFLITE | 13.774 ms | 4 - 33 MB | NPU | -- |
49
- | YOLOv11-Segmentation | float | SA8650 (Proxy) | Qualcomm® SA8650P (Proxy) | TFLITE | 8.675 ms | 4 - 30 MB | NPU | -- |
50
  | YOLOv11-Segmentation | float | SA8650 (Proxy) | Qualcomm® SA8650P (Proxy) | QNN_DLC | 4.761 ms | 5 - 28 MB | NPU | -- |
51
- | YOLOv11-Segmentation | float | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 10.54 ms | 4 - 65 MB | NPU | -- |
52
  | YOLOv11-Segmentation | float | SA8775P ADP | Qualcomm® SA8775P | QNN_DLC | 6.419 ms | 0 - 113 MB | NPU | -- |
53
- | YOLOv11-Segmentation | float | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 Mobile | TFLITE | 8.599 ms | 4 - 30 MB | NPU | -- |
54
  | YOLOv11-Segmentation | float | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 Mobile | QNN_DLC | 4.759 ms | 5 - 21 MB | NPU | -- |
55
- | YOLOv11-Segmentation | float | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 Mobile | ONNX | 104.627 ms | 90 - 104 MB | CPU | -- |
56
- | YOLOv11-Segmentation | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 6.191 ms | 4 - 75 MB | NPU | -- |
57
  | YOLOv11-Segmentation | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | QNN_DLC | 3.467 ms | 5 - 195 MB | NPU | -- |
58
- | YOLOv11-Segmentation | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 81.515 ms | 101 - 127 MB | CPU | -- |
59
- | YOLOv11-Segmentation | float | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite Mobile | TFLITE | 5.867 ms | 3 - 64 MB | NPU | -- |
60
  | YOLOv11-Segmentation | float | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite Mobile | QNN_DLC | 2.63 ms | 5 - 128 MB | NPU | -- |
61
- | YOLOv11-Segmentation | float | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite Mobile | ONNX | 89.263 ms | 106 - 121 MB | CPU | -- |
62
  | YOLOv11-Segmentation | float | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN_DLC | 5.408 ms | 5 - 5 MB | NPU | -- |
63
- | YOLOv11-Segmentation | float | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 32.052 ms | 114 - 114 MB | CPU | -- |
64
- | YOLOv11-Segmentation | w8a16 | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 Mobile | ONNX | 152.068 ms | 151 - 156 MB | CPU | -- |
65
- | YOLOv11-Segmentation | w8a16 | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 113.532 ms | 164 - 189 MB | CPU | -- |
66
- | YOLOv11-Segmentation | w8a16 | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite Mobile | ONNX | 111.728 ms | 149 - 167 MB | CPU | -- |
67
- | YOLOv11-Segmentation | w8a16 | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 570.501 ms | 258 - 258 MB | CPU | -- |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
 
 
 
69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
 
71
 
72
  ## License
@@ -83,26 +255,7 @@ This model is an implementation of YOLOv11-Segmentation found [here](https://git
83
 
84
 
85
  ## Community
86
- * Join [our AI Hub Slack community](https://qualcomm-ai-hub.slack.com/join/shared_invite/zt-2d5zsmas3-Sj0Q9TzslueCjS31eXG2UA#/shared-invite/email) to collaborate, post questions and learn more about on-device AI.
87
  * For questions or feedback please [reach out to us](mailto:[email protected]).
88
 
89
- ## Usage and Limitations
90
-
91
- Model may not be used for or in connection with any of the following applications:
92
-
93
- - Accessing essential private and public services and benefits;
94
- - Administration of justice and democratic processes;
95
- - Assessing or recognizing the emotional state of a person;
96
- - Biometric and biometrics-based systems, including categorization of persons based on sensitive characteristics;
97
- - Education and vocational training;
98
- - Employment and workers management;
99
- - Exploitation of the vulnerabilities of persons resulting in harmful behavior;
100
- - General purpose social scoring;
101
- - Law enforcement;
102
- - Management and operation of critical infrastructure;
103
- - Migration, asylum and border control management;
104
- - Predictive policing;
105
- - Real-time remote biometric identification in public spaces;
106
- - Recommender systems of social media platforms;
107
- - Scraping of facial images (from the internet or otherwise); and/or
108
- - Subliminal manipulation
 
19
  This model is an implementation of YOLOv11-Segmentation found [here](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/models/yolo/segment).
20
 
21
 
22
+ This repository provides scripts to run YOLOv11-Segmentation on Qualcomm® devices.
23
+ More details on model performance across various devices, can be found
24
+ [here](https://aihub.qualcomm.com/models/yolov11_seg).
25
+
26
+ **WARNING**: The model assets are not readily available for download due to licensing restrictions.
27
 
28
  ### Model Details
29
 
 
38
 
39
  | Model | Precision | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit | Target Model
40
  |---|---|---|---|---|---|---|---|---|
41
+ | YOLOv11-Segmentation | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | TFLITE | 21.044 ms | 4 - 65 MB | NPU | -- |
42
  | YOLOv11-Segmentation | float | QCS8275 (Proxy) | Qualcomm® QCS8275 (Proxy) | QNN_DLC | 16.17 ms | 1 - 114 MB | NPU | -- |
43
+ | YOLOv11-Segmentation | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 12.368 ms | 4 - 43 MB | NPU | -- |
44
+ | YOLOv11-Segmentation | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 8.576 ms | 4 - 34 MB | NPU | -- |
45
  | YOLOv11-Segmentation | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | QNN_DLC | 4.781 ms | 5 - 33 MB | NPU | -- |
46
+ | YOLOv11-Segmentation | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 10.533 ms | 4 - 66 MB | NPU | -- |
47
  | YOLOv11-Segmentation | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | QNN_DLC | 6.419 ms | 0 - 113 MB | NPU | -- |
48
+ | YOLOv11-Segmentation | float | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 21.044 ms | 4 - 65 MB | NPU | -- |
49
  | YOLOv11-Segmentation | float | SA7255P ADP | Qualcomm® SA7255P | QNN_DLC | 16.17 ms | 1 - 114 MB | NPU | -- |
50
+ | YOLOv11-Segmentation | float | SA8255 (Proxy) | Qualcomm® SA8255P (Proxy) | TFLITE | 8.635 ms | 4 - 33 MB | NPU | -- |
51
  | YOLOv11-Segmentation | float | SA8255 (Proxy) | Qualcomm® SA8255P (Proxy) | QNN_DLC | 4.742 ms | 5 - 25 MB | NPU | -- |
52
+ | YOLOv11-Segmentation | float | SA8295P ADP | Qualcomm® SA8295P | TFLITE | 13.865 ms | 4 - 32 MB | NPU | -- |
53
+ | YOLOv11-Segmentation | float | SA8650 (Proxy) | Qualcomm® SA8650P (Proxy) | TFLITE | 8.652 ms | 4 - 31 MB | NPU | -- |
54
  | YOLOv11-Segmentation | float | SA8650 (Proxy) | Qualcomm® SA8650P (Proxy) | QNN_DLC | 4.761 ms | 5 - 28 MB | NPU | -- |
55
+ | YOLOv11-Segmentation | float | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 10.533 ms | 4 - 66 MB | NPU | -- |
56
  | YOLOv11-Segmentation | float | SA8775P ADP | Qualcomm® SA8775P | QNN_DLC | 6.419 ms | 0 - 113 MB | NPU | -- |
57
+ | YOLOv11-Segmentation | float | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 Mobile | TFLITE | 8.585 ms | 4 - 31 MB | NPU | -- |
58
  | YOLOv11-Segmentation | float | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 Mobile | QNN_DLC | 4.759 ms | 5 - 21 MB | NPU | -- |
59
+ | YOLOv11-Segmentation | float | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 Mobile | ONNX | 111.796 ms | 96 - 98 MB | CPU | -- |
60
+ | YOLOv11-Segmentation | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 6.219 ms | 4 - 73 MB | NPU | -- |
61
  | YOLOv11-Segmentation | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | QNN_DLC | 3.467 ms | 5 - 195 MB | NPU | -- |
62
+ | YOLOv11-Segmentation | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 79.293 ms | 106 - 126 MB | CPU | -- |
63
+ | YOLOv11-Segmentation | float | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite Mobile | TFLITE | 5.86 ms | 3 - 64 MB | NPU | -- |
64
  | YOLOv11-Segmentation | float | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite Mobile | QNN_DLC | 2.63 ms | 5 - 128 MB | NPU | -- |
65
+ | YOLOv11-Segmentation | float | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite Mobile | ONNX | 73.092 ms | 110 - 124 MB | CPU | -- |
66
  | YOLOv11-Segmentation | float | Snapdragon X Elite CRD | Snapdragon® X Elite | QNN_DLC | 5.408 ms | 5 - 5 MB | NPU | -- |
67
+ | YOLOv11-Segmentation | float | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 30.343 ms | 133 - 133 MB | CPU | -- |
68
+ | YOLOv11-Segmentation | w8a16 | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 Mobile | ONNX | 142.504 ms | 153 - 156 MB | CPU | -- |
69
+ | YOLOv11-Segmentation | w8a16 | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 108.594 ms | 163 - 186 MB | CPU | -- |
70
+ | YOLOv11-Segmentation | w8a16 | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite Mobile | ONNX | 113.639 ms | 162 - 178 MB | CPU | -- |
71
+ | YOLOv11-Segmentation | w8a16 | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 71.144 ms | 266 - 266 MB | CPU | -- |
72
+
73
+
74
+
75
+
76
+ ## Installation
77
+
78
+
79
+ Install the package via pip:
80
+ ```bash
81
+ pip install "qai-hub-models[yolov11-seg]"
82
+ ```
83
+
84
+
85
+ ## Configure Qualcomm® AI Hub to run this model on a cloud-hosted device
86
+
87
+ Sign-in to [Qualcomm® AI Hub](https://app.aihub.qualcomm.com/) with your
88
+ Qualcomm® ID. Once signed in navigate to `Account -> Settings -> API Token`.
89
+
90
+ With this API token, you can configure your client to run models on the cloud
91
+ hosted devices.
92
+ ```bash
93
+ qai-hub configure --api_token API_TOKEN
94
+ ```
95
+ Navigate to [docs](https://app.aihub.qualcomm.com/docs/) for more information.
96
+
97
+
98
+
99
+ ## Demo off target
100
+
101
+ The package contains a simple end-to-end demo that downloads pre-trained
102
+ weights and runs this model on a sample input.
103
+
104
+ ```bash
105
+ python -m qai_hub_models.models.yolov11_seg.demo
106
+ ```
107
+
108
+ The above demo runs a reference implementation of pre-processing, model
109
+ inference, and post processing.
110
+
111
+ **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
112
+ environment, please add the following to your cell (instead of the above).
113
+ ```
114
+ %run -m qai_hub_models.models.yolov11_seg.demo
115
+ ```
116
+
117
+
118
+ ### Run model on a cloud-hosted device
119
+
120
+ In addition to the demo, you can also run the model on a cloud-hosted Qualcomm®
121
+ device. This script does the following:
122
+ * Performance check on-device on a cloud-hosted device
123
+ * Downloads compiled assets that can be deployed on-device for Android.
124
+ * Accuracy check between PyTorch and on-device outputs.
125
+
126
+ ```bash
127
+ python -m qai_hub_models.models.yolov11_seg.export
128
+ ```
129
+
130
+
131
+
132
+ ## How does this work?
133
+
134
+ This [export script](https://aihub.qualcomm.com/models/yolov11_seg/qai_hub_models/models/YOLOv11-Segmentation/export.py)
135
+ leverages [Qualcomm® AI Hub](https://aihub.qualcomm.com/) to optimize, validate, and deploy this model
136
+ on-device. Lets go through each step below in detail:
137
+
138
+ Step 1: **Compile model for on-device deployment**
139
+
140
+ To compile a PyTorch model for on-device deployment, we first trace the model
141
+ in memory using the `jit.trace` and then call the `submit_compile_job` API.
142
+
143
+ ```python
144
+ import torch
145
 
146
+ import qai_hub as hub
147
+ from qai_hub_models.models.yolov11_seg import Model
148
 
149
+ # Load the model
150
+ torch_model = Model.from_pretrained()
151
+
152
+ # Device
153
+ device = hub.Device("Samsung Galaxy S24")
154
+
155
+ # Trace model
156
+ input_shape = torch_model.get_input_spec()
157
+ sample_inputs = torch_model.sample_inputs()
158
+
159
+ pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
160
+
161
+ # Compile model on a specific device
162
+ compile_job = hub.submit_compile_job(
163
+ model=pt_model,
164
+ device=device,
165
+ input_specs=torch_model.get_input_spec(),
166
+ )
167
+
168
+ # Get target model to run on-device
169
+ target_model = compile_job.get_target_model()
170
+
171
+ ```
172
+
173
+
174
+ Step 2: **Performance profiling on cloud-hosted device**
175
+
176
+ After compiling models from step 1. Models can be profiled model on-device using the
177
+ `target_model`. Note that this scripts runs the model on a device automatically
178
+ provisioned in the cloud. Once the job is submitted, you can navigate to a
179
+ provided job URL to view a variety of on-device performance metrics.
180
+ ```python
181
+ profile_job = hub.submit_profile_job(
182
+ model=target_model,
183
+ device=device,
184
+ )
185
+
186
+ ```
187
+
188
+ Step 3: **Verify on-device accuracy**
189
+
190
+ To verify the accuracy of the model on-device, you can run on-device inference
191
+ on sample input data on the same cloud hosted device.
192
+ ```python
193
+ input_data = torch_model.sample_inputs()
194
+ inference_job = hub.submit_inference_job(
195
+ model=target_model,
196
+ device=device,
197
+ inputs=input_data,
198
+ )
199
+ on_device_output = inference_job.download_output_data()
200
+
201
+ ```
202
+ With the output of the model, you can compute like PSNR, relative errors or
203
+ spot check the output with expected output.
204
+
205
+ **Note**: This on-device profiling and inference requires access to Qualcomm®
206
+ AI Hub. [Sign up for access](https://myaccount.qualcomm.com/signup).
207
+
208
+
209
+
210
+ ## Run demo on a cloud-hosted device
211
+
212
+ You can also run the demo on-device.
213
+
214
+ ```bash
215
+ python -m qai_hub_models.models.yolov11_seg.demo --eval-mode on-device
216
+ ```
217
+
218
+ **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
219
+ environment, please add the following to your cell (instead of the above).
220
+ ```
221
+ %run -m qai_hub_models.models.yolov11_seg.demo -- --eval-mode on-device
222
+ ```
223
+
224
+
225
+ ## Deploying compiled model to Android
226
+
227
+
228
+ The models can be deployed using multiple runtimes:
229
+ - TensorFlow Lite (`.tflite` export): [This
230
+ tutorial](https://www.tensorflow.org/lite/android/quickstart) provides a
231
+ guide to deploy the .tflite model in an Android application.
232
+
233
+
234
+ - QNN (`.so` export ): This [sample
235
+ app](https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-50/sample_app.html)
236
+ provides instructions on how to use the `.so` shared library in an Android application.
237
+
238
+
239
+ ## View on Qualcomm® AI Hub
240
+ Get more details on YOLOv11-Segmentation's performance across various devices [here](https://aihub.qualcomm.com/models/yolov11_seg).
241
+ Explore all available models on [Qualcomm® AI Hub](https://aihub.qualcomm.com/)
242
 
243
 
244
  ## License
 
255
 
256
 
257
  ## Community
258
+ * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
259
  * For questions or feedback please [reach out to us](mailto:[email protected]).
260
 
261
+