qaihm-bot commited on
Commit
b06c330
·
verified ·
1 Parent(s): 96c32b9

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

Files changed (1) hide show
  1. README.md +47 -218
README.md CHANGED
@@ -10,236 +10,65 @@ pipeline_tag: image-segmentation
10
 
11
  ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/yolov11_seg/web-assets/model_demo.png)
12
 
13
- # YOLOv11-Segmentation: Optimized for Mobile Deployment
14
- ## Real-time object segmentation optimized for mobile and edge by Ultralytics
15
-
16
 
17
  Ultralytics YOLOv11 is a machine learning model that predicts bounding boxes, segmentation masks and classes of objects in an image.
18
 
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
-
30
- - **Model Type:** Model_use_case.semantic_segmentation
31
- - **Model Stats:**
32
- - Model checkpoint: YOLO11N-Seg
33
- - Input resolution: 640x640
34
- - Number of output classes: 80
35
- - Number of parameters: 2.89M
36
- - Model size (float): 11.1 MB
37
- - Model size (w8a16): 11.4 MB
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 | 15.485 ms | 4 - 224 MB | NPU | -- |
42
- | YOLOv11-Segmentation | float | QCS8450 (Proxy) | Qualcomm® QCS8450 (Proxy) | TFLITE | 10.778 ms | 4 - 187 MB | NPU | -- |
43
- | YOLOv11-Segmentation | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | TFLITE | 4.353 ms | 4 - 7 MB | NPU | -- |
44
- | YOLOv11-Segmentation | float | QCS8550 (Proxy) | Qualcomm® QCS8550 (Proxy) | ONNX | 6.335 ms | 14 - 19 MB | NPU | -- |
45
- | YOLOv11-Segmentation | float | QCS9075 (Proxy) | Qualcomm® QCS9075 (Proxy) | TFLITE | 6.157 ms | 4 - 205 MB | NPU | -- |
46
- | YOLOv11-Segmentation | float | SA7255P ADP | Qualcomm® SA7255P | TFLITE | 15.485 ms | 4 - 224 MB | NPU | -- |
47
- | YOLOv11-Segmentation | float | SA8295P ADP | Qualcomm® SA8295P | TFLITE | 9.355 ms | 4 - 169 MB | NPU | -- |
48
- | YOLOv11-Segmentation | float | SA8775P ADP | Qualcomm® SA8775P | TFLITE | 6.157 ms | 4 - 205 MB | NPU | -- |
49
- | YOLOv11-Segmentation | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | TFLITE | 3.2 ms | 0 - 375 MB | NPU | -- |
50
- | YOLOv11-Segmentation | float | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 Mobile | ONNX | 4.125 ms | 15 - 227 MB | NPU | -- |
51
- | YOLOv11-Segmentation | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | TFLITE | 2.414 ms | 0 - 216 MB | NPU | -- |
52
- | YOLOv11-Segmentation | float | Samsung Galaxy S25 | Snapdragon® 8 Elite For Galaxy Mobile | ONNX | 3.971 ms | 2 - 182 MB | NPU | -- |
53
- | YOLOv11-Segmentation | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | TFLITE | 1.968 ms | 0 - 236 MB | NPU | -- |
54
- | YOLOv11-Segmentation | float | Snapdragon 8 Elite Gen 5 QRD | Snapdragon® 8 Elite Gen 5 Mobile | ONNX | 3.117 ms | 1 - 153 MB | NPU | -- |
55
- | YOLOv11-Segmentation | float | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 6.373 ms | 17 - 17 MB | NPU | -- |
56
-
57
-
58
-
59
-
60
- ## Installation
61
-
62
-
63
- Install the package via pip:
64
- ```bash
65
- # NOTE: 3.10 <= PYTHON_VERSION < 3.14 is supported.
66
- pip install "qai-hub-models[yolov11-seg]"
67
- ```
68
-
69
-
70
- ## Configure Qualcomm® AI Hub Workbench to run this model on a cloud-hosted device
71
-
72
- Sign-in to [Qualcomm® AI Hub Workbench](https://workbench.aihub.qualcomm.com/) with your
73
- Qualcomm® ID. Once signed in navigate to `Account -> Settings -> API Token`.
74
-
75
- With this API token, you can configure your client to run models on the cloud
76
- hosted devices.
77
- ```bash
78
- qai-hub configure --api_token API_TOKEN
79
- ```
80
- Navigate to [docs](https://workbench.aihub.qualcomm.com/docs/) for more information.
81
-
82
-
83
-
84
- ## Demo off target
85
-
86
- The package contains a simple end-to-end demo that downloads pre-trained
87
- weights and runs this model on a sample input.
88
-
89
- ```bash
90
- python -m qai_hub_models.models.yolov11_seg.demo
91
- ```
92
-
93
- The above demo runs a reference implementation of pre-processing, model
94
- inference, and post processing.
95
-
96
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
97
- environment, please add the following to your cell (instead of the above).
98
- ```
99
- %run -m qai_hub_models.models.yolov11_seg.demo
100
- ```
101
-
102
-
103
- ### Run model on a cloud-hosted device
104
-
105
- In addition to the demo, you can also run the model on a cloud-hosted Qualcomm®
106
- device. This script does the following:
107
- * Performance check on-device on a cloud-hosted device
108
- * Downloads compiled assets that can be deployed on-device for Android.
109
- * Accuracy check between PyTorch and on-device outputs.
110
-
111
- ```bash
112
- python -m qai_hub_models.models.yolov11_seg.export
113
- ```
114
-
115
-
116
-
117
- ## How does this work?
118
-
119
- This [export script](https://aihub.qualcomm.com/models/yolov11_seg/qai_hub_models/models/YOLOv11-Segmentation/export.py)
120
- leverages [Qualcomm® AI Hub](https://aihub.qualcomm.com/) to optimize, validate, and deploy this model
121
- on-device. Lets go through each step below in detail:
122
-
123
- Step 1: **Compile model for on-device deployment**
124
-
125
- To compile a PyTorch model for on-device deployment, we first trace the model
126
- in memory using the `jit.trace` and then call the `submit_compile_job` API.
127
-
128
- ```python
129
- import torch
130
-
131
- import qai_hub as hub
132
- from qai_hub_models.models.yolov11_seg import Model
133
-
134
- # Load the model
135
- torch_model = Model.from_pretrained()
136
-
137
- # Device
138
- device = hub.Device("Samsung Galaxy S25")
139
-
140
- # Trace model
141
- input_shape = torch_model.get_input_spec()
142
- sample_inputs = torch_model.sample_inputs()
143
-
144
- pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
145
-
146
- # Compile model on a specific device
147
- compile_job = hub.submit_compile_job(
148
- model=pt_model,
149
- device=device,
150
- input_specs=torch_model.get_input_spec(),
151
- )
152
-
153
- # Get target model to run on-device
154
- target_model = compile_job.get_target_model()
155
-
156
- ```
157
-
158
-
159
- Step 2: **Performance profiling on cloud-hosted device**
160
-
161
- After compiling models from step 1. Models can be profiled model on-device using the
162
- `target_model`. Note that this scripts runs the model on a device automatically
163
- provisioned in the cloud. Once the job is submitted, you can navigate to a
164
- provided job URL to view a variety of on-device performance metrics.
165
- ```python
166
- profile_job = hub.submit_profile_job(
167
- model=target_model,
168
- device=device,
169
- )
170
-
171
- ```
172
-
173
- Step 3: **Verify on-device accuracy**
174
-
175
- To verify the accuracy of the model on-device, you can run on-device inference
176
- on sample input data on the same cloud hosted device.
177
- ```python
178
- input_data = torch_model.sample_inputs()
179
- inference_job = hub.submit_inference_job(
180
- model=target_model,
181
- device=device,
182
- inputs=input_data,
183
- )
184
- on_device_output = inference_job.download_output_data()
185
-
186
- ```
187
- With the output of the model, you can compute like PSNR, relative errors or
188
- spot check the output with expected output.
189
-
190
- **Note**: This on-device profiling and inference requires access to Qualcomm®
191
- AI Hub Workbench. [Sign up for access](https://myaccount.qualcomm.com/signup).
192
-
193
-
194
-
195
- ## Run demo on a cloud-hosted device
196
-
197
- You can also run the demo on-device.
198
-
199
- ```bash
200
- python -m qai_hub_models.models.yolov11_seg.demo --eval-mode on-device
201
- ```
202
-
203
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
204
- environment, please add the following to your cell (instead of the above).
205
- ```
206
- %run -m qai_hub_models.models.yolov11_seg.demo -- --eval-mode on-device
207
- ```
208
-
209
-
210
- ## Deploying compiled model to Android
211
-
212
-
213
- The models can be deployed using multiple runtimes:
214
- - TensorFlow Lite (`.tflite` export): [This
215
- tutorial](https://www.tensorflow.org/lite/android/quickstart) provides a
216
- guide to deploy the .tflite model in an Android application.
217
-
218
-
219
- - QNN (`.so` export ): This [sample
220
- app](https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-50/sample_app.html)
221
- provides instructions on how to use the `.so` shared library in an Android application.
222
-
223
-
224
- ## View on Qualcomm® AI Hub
225
- Get more details on YOLOv11-Segmentation's performance across various devices [here](https://aihub.qualcomm.com/models/yolov11_seg).
226
- Explore all available models on [Qualcomm® AI Hub](https://aihub.qualcomm.com/)
227
-
228
 
229
  ## License
230
  * The license for the original implementation of YOLOv11-Segmentation can be found
231
  [here](https://github.com/ultralytics/ultralytics/blob/main/LICENSE).
232
 
233
-
234
-
235
  ## References
236
  * [Ultralytics YOLOv11 Docs: Instance Segmentation](https://docs.ultralytics.com/tasks/segment/)
237
  * [Source Model Implementation](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/models/yolo/segment)
238
 
239
-
240
-
241
  ## Community
242
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
243
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).
244
-
245
-
 
10
 
11
  ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/yolov11_seg/web-assets/model_demo.png)
12
 
13
+ # YOLOv11-Segmentation: Optimized for Qualcomm Devices
 
 
14
 
15
  Ultralytics YOLOv11 is a machine learning model that predicts bounding boxes, segmentation masks and classes of objects in an image.
16
 
17
+ This is based on the implementation of YOLOv11-Segmentation found [here](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/models/yolo/segment).
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/yolov11_seg) 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
+ Due to licensing restrictions, we cannot distribute pre-exported model assets for this model.
24
+ Use the [Qualcomm® AI Hub Models](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/yolov11_seg) Python library to compile and export the model with your own:
25
+ - Custom weights (e.g., fine-tuned checkpoints)
26
+ - Custom input shapes
27
+ - Target device and runtime configurations
28
+
29
+ See our repository for [YOLOv11-Segmentation on GitHub](https://github.com/quic/ai-hub-models/blob/main/qai_hub_models/models/yolov11_seg) for usage instructions.
30
+
31
+
32
+ ## Model Details
33
+
34
+ **Model Type:** Model_use_case.semantic_segmentation
35
+
36
+ **Model Stats:**
37
+ - Model checkpoint: YOLO11N-Seg
38
+ - Input resolution: 640x640
39
+ - Number of output classes: 80
40
+ - Number of parameters: 2.89M
41
+ - Model size (float): 11.1 MB
42
+ - Model size (w8a16): 11.4 MB
43
+
44
+ ## Performance Summary
45
+ | Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit
46
+ |---|---|---|---|---|---|---
47
+ | YOLOv11-Segmentation | ONNX | float | Snapdragon® X Elite | 6.416 ms | 17 - 17 MB | NPU
48
+ | YOLOv11-Segmentation | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 4.233 ms | 2 - 206 MB | NPU
49
+ | YOLOv11-Segmentation | ONNX | float | Qualcomm® QCS8550 (Proxy) | 6.171 ms | 11 - 15 MB | NPU
50
+ | YOLOv11-Segmentation | ONNX | float | Qualcomm® QCS9075 | 8.053 ms | 11 - 14 MB | NPU
51
+ | YOLOv11-Segmentation | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 3.491 ms | 1 - 160 MB | NPU
52
+ | YOLOv11-Segmentation | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 3.043 ms | 0 - 155 MB | NPU
53
+ | YOLOv11-Segmentation | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 3.147 ms | 0 - 171 MB | NPU
54
+ | YOLOv11-Segmentation | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 15.466 ms | 4 - 111 MB | NPU
55
+ | YOLOv11-Segmentation | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 4.342 ms | 4 - 9 MB | NPU
56
+ | YOLOv11-Segmentation | TFLITE | float | Qualcomm® SA8775P | 6.082 ms | 4 - 113 MB | NPU
57
+ | YOLOv11-Segmentation | TFLITE | float | Qualcomm® QCS9075 | 5.829 ms | 4 - 22 MB | NPU
58
+ | YOLOv11-Segmentation | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 10.084 ms | 4 - 210 MB | NPU
59
+ | YOLOv11-Segmentation | TFLITE | float | Qualcomm® SA7255P | 15.466 ms | 4 - 111 MB | NPU
60
+ | YOLOv11-Segmentation | TFLITE | float | Qualcomm® SA8295P | 9.237 ms | 4 - 177 MB | NPU
61
+ | YOLOv11-Segmentation | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 2.39 ms | 0 - 116 MB | NPU
62
+ | YOLOv11-Segmentation | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 1.957 ms | 0 - 121 MB | NPU
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
 
64
  ## License
65
  * The license for the original implementation of YOLOv11-Segmentation can be found
66
  [here](https://github.com/ultralytics/ultralytics/blob/main/LICENSE).
67
 
 
 
68
  ## References
69
  * [Ultralytics YOLOv11 Docs: Instance Segmentation](https://docs.ultralytics.com/tasks/segment/)
70
  * [Source Model Implementation](https://github.com/ultralytics/ultralytics/tree/main/ultralytics/models/yolo/segment)
71
 
 
 
72
  ## Community
73
  * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
74
  * For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).