qaihm-bot commited on
Commit
45efa93
·
verified ·
1 Parent(s): 9f785c6

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +39 -199
README.md CHANGED
@@ -1,10 +1,10 @@
1
  ---
2
  library_name: pytorch
3
  license: agpl-3.0
4
- pipeline_tag: image-segmentation
5
  tags:
6
  - real_time
7
  - android
 
8
 
9
  ---
10
 
@@ -19,10 +19,7 @@ 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
- 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
 
27
  ### Model Details
28
 
@@ -36,200 +33,24 @@ More details on model performance across various devices, can be found
36
 
37
  | Model | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
38
  |---|---|---|---|---|---|---|---|---|
39
- | YOLOv11-Segmentation | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 6.693 ms | 4 - 23 MB | FP16 | NPU | [YOLOv11-Segmentation.tflite](https://huggingface.co/qualcomm/YOLOv11-Segmentation/blob/main/YOLOv11-Segmentation.tflite) |
40
- | YOLOv11-Segmentation | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 123.821 ms | 95 - 109 MB | FP32 | CPU | [YOLOv11-Segmentation.onnx](https://huggingface.co/qualcomm/YOLOv11-Segmentation/blob/main/YOLOv11-Segmentation.onnx) |
41
- | YOLOv11-Segmentation | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 4.927 ms | 4 - 61 MB | FP16 | NPU | [YOLOv11-Segmentation.tflite](https://huggingface.co/qualcomm/YOLOv11-Segmentation/blob/main/YOLOv11-Segmentation.tflite) |
42
- | YOLOv11-Segmentation | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 83.391 ms | 101 - 129 MB | FP32 | CPU | [YOLOv11-Segmentation.onnx](https://huggingface.co/qualcomm/YOLOv11-Segmentation/blob/main/YOLOv11-Segmentation.onnx) |
43
- | YOLOv11-Segmentation | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 4.723 ms | 4 - 57 MB | FP16 | NPU | [YOLOv11-Segmentation.tflite](https://huggingface.co/qualcomm/YOLOv11-Segmentation/blob/main/YOLOv11-Segmentation.tflite) |
44
- | YOLOv11-Segmentation | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 88.892 ms | 100 - 115 MB | FP32 | CPU | [YOLOv11-Segmentation.onnx](https://huggingface.co/qualcomm/YOLOv11-Segmentation/blob/main/YOLOv11-Segmentation.onnx) |
45
- | YOLOv11-Segmentation | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 6.725 ms | 4 - 27 MB | FP16 | NPU | [YOLOv11-Segmentation.tflite](https://huggingface.co/qualcomm/YOLOv11-Segmentation/blob/main/YOLOv11-Segmentation.tflite) |
46
- | YOLOv11-Segmentation | SA7255P ADP | SA7255P | TFLITE | 81.221 ms | 4 - 51 MB | FP16 | NPU | [YOLOv11-Segmentation.tflite](https://huggingface.co/qualcomm/YOLOv11-Segmentation/blob/main/YOLOv11-Segmentation.tflite) |
47
- | YOLOv11-Segmentation | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 6.681 ms | 4 - 27 MB | FP16 | NPU | [YOLOv11-Segmentation.tflite](https://huggingface.co/qualcomm/YOLOv11-Segmentation/blob/main/YOLOv11-Segmentation.tflite) |
48
- | YOLOv11-Segmentation | SA8295P ADP | SA8295P | TFLITE | 12.22 ms | 4 - 42 MB | FP16 | NPU | [YOLOv11-Segmentation.tflite](https://huggingface.co/qualcomm/YOLOv11-Segmentation/blob/main/YOLOv11-Segmentation.tflite) |
49
- | YOLOv11-Segmentation | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 6.739 ms | 4 - 22 MB | FP16 | NPU | [YOLOv11-Segmentation.tflite](https://huggingface.co/qualcomm/YOLOv11-Segmentation/blob/main/YOLOv11-Segmentation.tflite) |
50
- | YOLOv11-Segmentation | SA8775P ADP | SA8775P | TFLITE | 10.058 ms | 4 - 52 MB | FP16 | NPU | [YOLOv11-Segmentation.tflite](https://huggingface.co/qualcomm/YOLOv11-Segmentation/blob/main/YOLOv11-Segmentation.tflite) |
51
- | YOLOv11-Segmentation | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 10.725 ms | 4 - 43 MB | FP16 | NPU | [YOLOv11-Segmentation.tflite](https://huggingface.co/qualcomm/YOLOv11-Segmentation/blob/main/YOLOv11-Segmentation.tflite) |
52
- | YOLOv11-Segmentation | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 32.261 ms | 117 - 117 MB | FP32 | CPU | [YOLOv11-Segmentation.onnx](https://huggingface.co/qualcomm/YOLOv11-Segmentation/blob/main/YOLOv11-Segmentation.onnx) |
53
-
54
-
55
-
56
-
57
- ## Installation
58
-
59
-
60
- Install the package via pip:
61
- ```bash
62
- pip install "qai-hub-models[yolov11-seg]"
63
- ```
64
-
65
-
66
- ## Configure Qualcomm® AI Hub to run this model on a cloud-hosted device
67
-
68
- Sign-in to [Qualcomm® AI Hub](https://app.aihub.qualcomm.com/) with your
69
- Qualcomm® ID. Once signed in navigate to `Account -> Settings -> API Token`.
70
-
71
- With this API token, you can configure your client to run models on the cloud
72
- hosted devices.
73
- ```bash
74
- qai-hub configure --api_token API_TOKEN
75
- ```
76
- Navigate to [docs](https://app.aihub.qualcomm.com/docs/) for more information.
77
-
78
-
79
-
80
- ## Demo off target
81
-
82
- The package contains a simple end-to-end demo that downloads pre-trained
83
- weights and runs this model on a sample input.
84
-
85
- ```bash
86
- python -m qai_hub_models.models.yolov11_seg.demo
87
- ```
88
-
89
- The above demo runs a reference implementation of pre-processing, model
90
- inference, and post processing.
91
-
92
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
93
- environment, please add the following to your cell (instead of the above).
94
- ```
95
- %run -m qai_hub_models.models.yolov11_seg.demo
96
- ```
97
-
98
-
99
- ### Run model on a cloud-hosted device
100
-
101
- In addition to the demo, you can also run the model on a cloud-hosted Qualcomm®
102
- device. This script does the following:
103
- * Performance check on-device on a cloud-hosted device
104
- * Downloads compiled assets that can be deployed on-device for Android.
105
- * Accuracy check between PyTorch and on-device outputs.
106
-
107
- ```bash
108
- python -m qai_hub_models.models.yolov11_seg.export
109
- ```
110
- ```
111
- Profiling Results
112
- ------------------------------------------------------------
113
- YOLOv11-Segmentation
114
- Device : Samsung Galaxy S23 (13)
115
- Runtime : TFLITE
116
- Estimated inference time (ms) : 6.7
117
- Estimated peak memory usage (MB): [4, 23]
118
- Total # Ops : 429
119
- Compute Unit(s) : NPU (429 ops)
120
- ```
121
-
122
-
123
- ## How does this work?
124
-
125
- This [export script](https://aihub.qualcomm.com/models/yolov11_seg/qai_hub_models/models/YOLOv11-Segmentation/export.py)
126
- leverages [Qualcomm® AI Hub](https://aihub.qualcomm.com/) to optimize, validate, and deploy this model
127
- on-device. Lets go through each step below in detail:
128
-
129
- Step 1: **Compile model for on-device deployment**
130
-
131
- To compile a PyTorch model for on-device deployment, we first trace the model
132
- in memory using the `jit.trace` and then call the `submit_compile_job` API.
133
 
134
- ```python
135
- import torch
136
 
137
- import qai_hub as hub
138
- from qai_hub_models.models.yolov11_seg import Model
139
-
140
- # Load the model
141
- torch_model = Model.from_pretrained()
142
-
143
- # Device
144
- device = hub.Device("Samsung Galaxy S24")
145
-
146
- # Trace model
147
- input_shape = torch_model.get_input_spec()
148
- sample_inputs = torch_model.sample_inputs()
149
-
150
- pt_model = torch.jit.trace(torch_model, [torch.tensor(data[0]) for _, data in sample_inputs.items()])
151
-
152
- # Compile model on a specific device
153
- compile_job = hub.submit_compile_job(
154
- model=pt_model,
155
- device=device,
156
- input_specs=torch_model.get_input_spec(),
157
- )
158
-
159
- # Get target model to run on-device
160
- target_model = compile_job.get_target_model()
161
-
162
- ```
163
-
164
-
165
- Step 2: **Performance profiling on cloud-hosted device**
166
-
167
- After compiling models from step 1. Models can be profiled model on-device using the
168
- `target_model`. Note that this scripts runs the model on a device automatically
169
- provisioned in the cloud. Once the job is submitted, you can navigate to a
170
- provided job URL to view a variety of on-device performance metrics.
171
- ```python
172
- profile_job = hub.submit_profile_job(
173
- model=target_model,
174
- device=device,
175
- )
176
-
177
- ```
178
-
179
- Step 3: **Verify on-device accuracy**
180
-
181
- To verify the accuracy of the model on-device, you can run on-device inference
182
- on sample input data on the same cloud hosted device.
183
- ```python
184
- input_data = torch_model.sample_inputs()
185
- inference_job = hub.submit_inference_job(
186
- model=target_model,
187
- device=device,
188
- inputs=input_data,
189
- )
190
- on_device_output = inference_job.download_output_data()
191
-
192
- ```
193
- With the output of the model, you can compute like PSNR, relative errors or
194
- spot check the output with expected output.
195
-
196
- **Note**: This on-device profiling and inference requires access to Qualcomm®
197
- AI Hub. [Sign up for access](https://myaccount.qualcomm.com/signup).
198
-
199
-
200
-
201
- ## Run demo on a cloud-hosted device
202
-
203
- You can also run the demo on-device.
204
-
205
- ```bash
206
- python -m qai_hub_models.models.yolov11_seg.demo --on-device
207
- ```
208
-
209
- **NOTE**: If you want running in a Jupyter Notebook or Google Colab like
210
- environment, please add the following to your cell (instead of the above).
211
- ```
212
- %run -m qai_hub_models.models.yolov11_seg.demo -- --on-device
213
- ```
214
-
215
-
216
- ## Deploying compiled model to Android
217
-
218
-
219
- The models can be deployed using multiple runtimes:
220
- - TensorFlow Lite (`.tflite` export): [This
221
- tutorial](https://www.tensorflow.org/lite/android/quickstart) provides a
222
- guide to deploy the .tflite model in an Android application.
223
-
224
-
225
- - QNN (`.so` export ): This [sample
226
- app](https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-50/sample_app.html)
227
- provides instructions on how to use the `.so` shared library in an Android application.
228
-
229
-
230
- ## View on Qualcomm® AI Hub
231
- Get more details on YOLOv11-Segmentation's performance across various devices [here](https://aihub.qualcomm.com/models/yolov11_seg).
232
- Explore all available models on [Qualcomm® AI Hub](https://aihub.qualcomm.com/)
233
 
234
 
235
  ## License
@@ -246,7 +67,26 @@ Explore all available models on [Qualcomm® AI Hub](https://aihub.qualcomm.com/)
246
 
247
 
248
  ## Community
249
- * Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
250
  * For questions or feedback please [reach out to us](mailto:[email protected]).
251
 
252
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  library_name: pytorch
3
  license: agpl-3.0
 
4
  tags:
5
  - real_time
6
  - android
7
+ pipeline_tag: image-segmentation
8
 
9
  ---
10
 
 
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
 
 
33
 
34
  | Model | Device | Chipset | Target Runtime | Inference Time (ms) | Peak Memory Range (MB) | Precision | Primary Compute Unit | Target Model
35
  |---|---|---|---|---|---|---|---|---|
36
+ | YOLOv11-Segmentation | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | TFLITE | 6.633 ms | 4 - 30 MB | FP16 | NPU | -- |
37
+ | YOLOv11-Segmentation | Samsung Galaxy S23 | Snapdragon® 8 Gen 2 | ONNX | 104.404 ms | 95 - 108 MB | FP32 | CPU | -- |
38
+ | YOLOv11-Segmentation | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | TFLITE | 4.766 ms | 0 - 53 MB | FP16 | NPU | -- |
39
+ | YOLOv11-Segmentation | Samsung Galaxy S24 | Snapdragon® 8 Gen 3 | ONNX | 86.584 ms | 97 - 120 MB | FP32 | CPU | -- |
40
+ | YOLOv11-Segmentation | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | TFLITE | 3.908 ms | 0 - 54 MB | FP16 | NPU | -- |
41
+ | YOLOv11-Segmentation | Snapdragon 8 Elite QRD | Snapdragon® 8 Elite | ONNX | 88.869 ms | 98 - 114 MB | FP32 | CPU | -- |
42
+ | YOLOv11-Segmentation | SA7255P ADP | SA7255P | TFLITE | 81.11 ms | 4 - 50 MB | FP16 | NPU | -- |
43
+ | YOLOv11-Segmentation | SA8255 (Proxy) | SA8255P Proxy | TFLITE | 6.575 ms | 4 - 22 MB | FP16 | NPU | -- |
44
+ | YOLOv11-Segmentation | SA8295P ADP | SA8295P | TFLITE | 11.829 ms | 4 - 38 MB | FP16 | NPU | -- |
45
+ | YOLOv11-Segmentation | SA8650 (Proxy) | SA8650P Proxy | TFLITE | 6.586 ms | 4 - 31 MB | FP16 | NPU | -- |
46
+ | YOLOv11-Segmentation | SA8775P ADP | SA8775P | TFLITE | 9.978 ms | 4 - 51 MB | FP16 | NPU | -- |
47
+ | YOLOv11-Segmentation | QCS8275 (Proxy) | QCS8275 Proxy | TFLITE | 81.11 ms | 4 - 50 MB | FP16 | NPU | -- |
48
+ | YOLOv11-Segmentation | QCS8550 (Proxy) | QCS8550 Proxy | TFLITE | 6.612 ms | 4 - 31 MB | FP16 | NPU | -- |
49
+ | YOLOv11-Segmentation | QCS9075 (Proxy) | QCS9075 Proxy | TFLITE | 9.978 ms | 4 - 51 MB | FP16 | NPU | -- |
50
+ | YOLOv11-Segmentation | QCS8450 (Proxy) | QCS8450 Proxy | TFLITE | 10.242 ms | 4 - 43 MB | FP16 | NPU | -- |
51
+ | YOLOv11-Segmentation | Snapdragon X Elite CRD | Snapdragon® X Elite | ONNX | 31.289 ms | 116 - 116 MB | FP32 | CPU | -- |
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
 
 
 
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
 
55
 
56
  ## License
 
67
 
68
 
69
  ## Community
70
+ * 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.
71
  * For questions or feedback please [reach out to us](mailto:[email protected]).
72
 
73
+ ## Usage and Limitations
74
+
75
+ Model may not be used for or in connection with any of the following applications:
76
+
77
+ - Accessing essential private and public services and benefits;
78
+ - Administration of justice and democratic processes;
79
+ - Assessing or recognizing the emotional state of a person;
80
+ - Biometric and biometrics-based systems, including categorization of persons based on sensitive characteristics;
81
+ - Education and vocational training;
82
+ - Employment and workers management;
83
+ - Exploitation of the vulnerabilities of persons resulting in harmful behavior;
84
+ - General purpose social scoring;
85
+ - Law enforcement;
86
+ - Management and operation of critical infrastructure;
87
+ - Migration, asylum and border control management;
88
+ - Predictive policing;
89
+ - Real-time remote biometric identification in public spaces;
90
+ - Recommender systems of social media platforms;
91
+ - Scraping of facial images (from the internet or otherwise); and/or
92
+ - Subliminal manipulation