Unet-Segmentation / README.md
qaihm-bot's picture
v0.59.0
4fabbe2 verified
|
Raw
History Blame Contribute Delete
13.9 kB
---
library_name: pytorch
license: other
tags:
- backbone
- bu_auto
- real_time
- android
pipeline_tag: image-segmentation
---
![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/unet_segmentation/web-assets/model_demo.png)
# Unet-Segmentation: Optimized for Qualcomm Devices
UNet is a machine learning model that produces a segmentation mask for an image. The most basic use case will label each pixel in the image as being in the foreground or the background. More advanced usage will assign a class label to each pixel. This version of the model was trained on the data from Kaggle's Carvana Image Masking Challenge (see https://www.kaggle.com/c/carvana-image-masking-challenge) and is used for vehicle segmentation.
This is based on the implementation of Unet-Segmentation found [here](https://github.com/milesial/Pytorch-UNet).
This repository contains pre-exported model files optimized for Qualcomm® devices. You can use the [Qualcomm® AI Hub Models](https://github.com/qualcomm/ai-hub-models/blob/v0.59.0/src/qai_hub_models/models/unet_segmentation) library to export with custom configurations. More details on model performance across various devices, can be found [here](#performance-summary).
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.
## Getting Started
There are two ways to deploy this model on your device:
### Option 1: Download Pre-Exported Models
Below are pre-exported model assets ready for deployment.
| Runtime | Precision | Chipset | SDK Versions | Download |
|---|---|---|---|---|
| ONNX | float | Universal | QAIRT 2.45, ONNX Runtime 1.27.1 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/unet_segmentation/releases/v0.59.0/unet_segmentation-onnx-float.zip)
| ONNX | w8a8 | Universal | QAIRT 2.45, ONNX Runtime 1.27.1 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/unet_segmentation/releases/v0.59.0/unet_segmentation-onnx-w8a8.zip)
| QNN_DLC | float | Universal | QAIRT 2.45 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/unet_segmentation/releases/v0.59.0/unet_segmentation-qnn_dlc-float.zip)
| QNN_DLC | w8a8 | Universal | QAIRT 2.45 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/unet_segmentation/releases/v0.59.0/unet_segmentation-qnn_dlc-w8a8.zip)
| TFLITE | float | Universal | QAIRT 2.45 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/unet_segmentation/releases/v0.59.0/unet_segmentation-tflite-float.zip)
| TFLITE | w8a8 | Universal | QAIRT 2.45 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/unet_segmentation/releases/v0.59.0/unet_segmentation-tflite-w8a8.zip)
For more device-specific assets and performance metrics, visit **[Unet-Segmentation on Qualcomm® AI Hub](https://aihub.qualcomm.com/models/unet_segmentation)**.
### Option 2: Export with Custom Configurations
Use the [Qualcomm® AI Hub Models](https://github.com/qualcomm/ai-hub-models/blob/v0.59.0/src/qai_hub_models/models/unet_segmentation) Python library to compile and export the model with your own:
- Custom weights (e.g., fine-tuned checkpoints)
- Custom input shapes
- Target device and runtime configurations
This option is ideal if you need to customize the model beyond the default configuration provided here.
See our repository for [Unet-Segmentation on GitHub](https://github.com/qualcomm/ai-hub-models/blob/v0.59.0/src/qai_hub_models/models/unet_segmentation) for usage instructions.
## Model Details
**Model Type:** Model_use_case.semantic_segmentation
**Model Stats:**
- Model checkpoint: unet_carvana_scale1.0_epoch2
- Input resolution: 640x1280
- Number of output classes: 2 (foreground / background)
- Number of parameters: 31.0M
- Model size (float): 118 MB
- Model size (w8a8): 29.8 MB
## Performance Summary
| Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit
|---|---|---|---|---|---|---
| Unet-Segmentation | ONNX | float | Snapdragon® X2 Elite | 74.926 ms | 17 - 17 MB | NPU
| Unet-Segmentation | ONNX | float | Snapdragon® X Elite | 142.497 ms | 54 - 54 MB | NPU
| Unet-Segmentation | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 114.579 ms | 23 - 546 MB | NPU
| Unet-Segmentation | ONNX | float | Snapdragon® 8 Gen 1 Mobile | 289.805 ms | 1 - 549 MB | NPU
| Unet-Segmentation | ONNX | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 159.65 ms | 0 - 57 MB | NPU
| Unet-Segmentation | ONNX | float | Qualcomm® QCS8450 | 289.805 ms | 1 - 549 MB | NPU
| Unet-Segmentation | ONNX | float | Qualcomm® Dragonwing™ IQ-9075 | 249.85 ms | 9 - 21 MB | NPU
| Unet-Segmentation | ONNX | float | Qualcomm® Dragonwing™ IQ-X7181 | 142.497 ms | 54 - 54 MB | NPU
| Unet-Segmentation | ONNX | float | Qualcomm® Dragonwing™ Q-8750 | 91.522 ms | 15 - 334 MB | NPU
| Unet-Segmentation | ONNX | float | Snapdragon® 8 Elite Mobile | 91.522 ms | 15 - 334 MB | NPU
| Unet-Segmentation | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 66.985 ms | 14 - 343 MB | NPU
| Unet-Segmentation | ONNX | w8a8 | Snapdragon® X2 Elite | 18.89 ms | 5 - 5 MB | NPU
| Unet-Segmentation | ONNX | w8a8 | Snapdragon® X Elite | 37.719 ms | 29 - 29 MB | NPU
| Unet-Segmentation | ONNX | w8a8 | Snapdragon® 8 Gen 3 Mobile | 29.764 ms | 6 - 340 MB | NPU
| Unet-Segmentation | ONNX | w8a8 | Snapdragon® 8 Gen 1 Mobile | 68.38 ms | 6 - 342 MB | NPU
| Unet-Segmentation | ONNX | w8a8 | Qualcomm® Dragonwing™ QCS6490 | 299.862 ms | 3 - 8 MB | NPU
| Unet-Segmentation | ONNX | w8a8 | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 38.042 ms | 0 - 32 MB | NPU
| Unet-Segmentation | ONNX | w8a8 | Qualcomm® QCS8450 | 68.38 ms | 6 - 342 MB | NPU
| Unet-Segmentation | ONNX | w8a8 | Qualcomm® Dragonwing™ IQ-9075 | 35.708 ms | 4 - 7 MB | NPU
| Unet-Segmentation | ONNX | w8a8 | Qualcomm® Dragonwing™ IQ-X7181 | 37.719 ms | 29 - 29 MB | NPU
| Unet-Segmentation | ONNX | w8a8 | Qualcomm® Dragonwing™ Q-8750 | 24.393 ms | 3 - 189 MB | NPU
| Unet-Segmentation | ONNX | w8a8 | Snapdragon® 8 Elite Mobile | 24.393 ms | 3 - 189 MB | NPU
| Unet-Segmentation | ONNX | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 16.406 ms | 3 - 192 MB | NPU
| Unet-Segmentation | QNN_DLC | float | Snapdragon® X2 Elite | 71.644 ms | 9 - 9 MB | NPU
| Unet-Segmentation | QNN_DLC | float | Snapdragon® X Elite | 132.325 ms | 9 - 9 MB | NPU
| Unet-Segmentation | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 102.166 ms | 139 - 655 MB | NPU
| Unet-Segmentation | QNN_DLC | float | Snapdragon® 8 Gen 1 Mobile | 283.41 ms | 5 - 540 MB | NPU
| Unet-Segmentation | QNN_DLC | float | Qualcomm® Dragonwing™ QCS8275 | 953.564 ms | 1 - 324 MB | NPU
| Unet-Segmentation | QNN_DLC | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 138.073 ms | 9 - 13 MB | NPU
| Unet-Segmentation | QNN_DLC | float | Qualcomm® SA8775P | 240.435 ms | 2 - 325 MB | NPU
| Unet-Segmentation | QNN_DLC | float | Qualcomm® SA8650P | 240.435 ms | 2 - 325 MB | NPU
| Unet-Segmentation | QNN_DLC | float | Qualcomm® SA8255P | 240.435 ms | 2 - 325 MB | NPU
| Unet-Segmentation | QNN_DLC | float | Qualcomm® QCS8450 | 283.41 ms | 5 - 540 MB | NPU
| Unet-Segmentation | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-9075 | 239.046 ms | 9 - 27 MB | NPU
| Unet-Segmentation | QNN_DLC | float | Qualcomm® Dragonwing™ IQ-X7181 | 132.325 ms | 9 - 9 MB | NPU
| Unet-Segmentation | QNN_DLC | float | Qualcomm® Dragonwing™ Q-8750 | 81.754 ms | 0 - 332 MB | NPU
| Unet-Segmentation | QNN_DLC | float | Qualcomm® SA7255P | 953.564 ms | 1 - 324 MB | NPU
| Unet-Segmentation | QNN_DLC | float | Qualcomm® SA8295P | 274.424 ms | 0 - 322 MB | NPU
| Unet-Segmentation | QNN_DLC | float | Snapdragon® 8 Elite Mobile | 81.754 ms | 0 - 332 MB | NPU
| Unet-Segmentation | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 61.146 ms | 0 - 345 MB | NPU
| Unet-Segmentation | QNN_DLC | w8a8 | Snapdragon® X2 Elite | 18.842 ms | 2 - 2 MB | NPU
| Unet-Segmentation | QNN_DLC | w8a8 | Snapdragon® X Elite | 35.723 ms | 2 - 2 MB | NPU
| Unet-Segmentation | QNN_DLC | w8a8 | Snapdragon® 8 Gen 3 Mobile | 26.201 ms | 2 - 320 MB | NPU
| Unet-Segmentation | QNN_DLC | w8a8 | Snapdragon® 8 Gen 1 Mobile | 58.741 ms | 2 - 318 MB | NPU
| Unet-Segmentation | QNN_DLC | w8a8 | Qualcomm® Dragonwing™ QCS6490 | 287.899 ms | 4 - 9 MB | NPU
| Unet-Segmentation | QNN_DLC | w8a8 | Qualcomm® Dragonwing™ QCS8275 | 121.487 ms | 1 - 180 MB | NPU
| Unet-Segmentation | QNN_DLC | w8a8 | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 34.563 ms | 3 - 31 MB | NPU
| Unet-Segmentation | QNN_DLC | w8a8 | Qualcomm® SA8775P | 32.187 ms | 1 - 181 MB | NPU
| Unet-Segmentation | QNN_DLC | w8a8 | Qualcomm® SA8650P | 32.187 ms | 1 - 181 MB | NPU
| Unet-Segmentation | QNN_DLC | w8a8 | Qualcomm® SA8255P | 32.187 ms | 1 - 181 MB | NPU
| Unet-Segmentation | QNN_DLC | w8a8 | Qualcomm® QCS8450 | 58.741 ms | 2 - 318 MB | NPU
| Unet-Segmentation | QNN_DLC | w8a8 | Qualcomm® Dragonwing™ IQ-9075 | 32.544 ms | 1 - 7 MB | NPU
| Unet-Segmentation | QNN_DLC | w8a8 | Qualcomm® Dragonwing™ IQ-X7181 | 35.723 ms | 2 - 2 MB | NPU
| Unet-Segmentation | QNN_DLC | w8a8 | Qualcomm® Dragonwing™ Q-6690 | 1233.117 ms | 31 - 551 MB | NPU
| Unet-Segmentation | QNN_DLC | w8a8 | Qualcomm® Dragonwing™ Q-7790 | 79.054 ms | 2 - 267 MB | NPU
| Unet-Segmentation | QNN_DLC | w8a8 | Qualcomm® Dragonwing™ Q-8750 | 21.707 ms | 2 - 188 MB | NPU
| Unet-Segmentation | QNN_DLC | w8a8 | Qualcomm® SA7255P | 121.487 ms | 1 - 180 MB | NPU
| Unet-Segmentation | QNN_DLC | w8a8 | Qualcomm® SA8295P | 63.726 ms | 0 - 180 MB | NPU
| Unet-Segmentation | QNN_DLC | w8a8 | Snapdragon® 8 Elite Mobile | 21.707 ms | 2 - 188 MB | NPU
| Unet-Segmentation | QNN_DLC | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 15.858 ms | 2 - 200 MB | NPU
| Unet-Segmentation | QNN_DLC | w8a8 | Snapdragon® 7 Gen 4 Mobile | 79.054 ms | 2 - 267 MB | NPU
| Unet-Segmentation | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 104.617 ms | 6 - 576 MB | NPU
| Unet-Segmentation | TFLITE | float | Snapdragon® 8 Gen 1 Mobile | 278.817 ms | 7 - 589 MB | NPU
| Unet-Segmentation | TFLITE | float | Qualcomm® Dragonwing™ QCS8275 | 953.52 ms | 0 - 324 MB | NPU
| Unet-Segmentation | TFLITE | float | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 144.104 ms | 6 - 443 MB | NPU
| Unet-Segmentation | TFLITE | float | Qualcomm® SA8775P | 240.471 ms | 7 - 330 MB | NPU
| Unet-Segmentation | TFLITE | float | Qualcomm® SA8650P | 240.471 ms | 7 - 330 MB | NPU
| Unet-Segmentation | TFLITE | float | Qualcomm® SA8255P | 240.471 ms | 7 - 330 MB | NPU
| Unet-Segmentation | TFLITE | float | Qualcomm® QCS8450 | 278.817 ms | 7 - 589 MB | NPU
| Unet-Segmentation | TFLITE | float | Qualcomm® Dragonwing™ IQ-9075 | 239.448 ms | 6 - 86 MB | NPU
| Unet-Segmentation | TFLITE | float | Qualcomm® Dragonwing™ Q-8750 | 82.942 ms | 0 - 332 MB | NPU
| Unet-Segmentation | TFLITE | float | Qualcomm® SA7255P | 953.52 ms | 0 - 324 MB | NPU
| Unet-Segmentation | TFLITE | float | Qualcomm® SA8295P | 274.445 ms | 7 - 329 MB | NPU
| Unet-Segmentation | TFLITE | float | Snapdragon® 8 Elite Mobile | 82.942 ms | 0 - 332 MB | NPU
| Unet-Segmentation | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 64.672 ms | 0 - 340 MB | NPU
| Unet-Segmentation | TFLITE | w8a8 | Snapdragon® 8 Gen 3 Mobile | 26.23 ms | 1 - 316 MB | NPU
| Unet-Segmentation | TFLITE | w8a8 | Snapdragon® 8 Gen 1 Mobile | 60.694 ms | 2 - 319 MB | NPU
| Unet-Segmentation | TFLITE | w8a8 | Qualcomm® Dragonwing™ QCS6490 | 288.767 ms | 1 - 41 MB | NPU
| Unet-Segmentation | TFLITE | w8a8 | Qualcomm® Dragonwing™ QCS8275 | 121.558 ms | 2 - 181 MB | NPU
| Unet-Segmentation | TFLITE | w8a8 | Qualcomm® Dragonwing™ QCS8550 (Proxy) | 33.929 ms | 2 - 624 MB | NPU
| Unet-Segmentation | TFLITE | w8a8 | Qualcomm® SA8775P | 32.204 ms | 2 - 180 MB | NPU
| Unet-Segmentation | TFLITE | w8a8 | Qualcomm® SA8650P | 32.204 ms | 2 - 180 MB | NPU
| Unet-Segmentation | TFLITE | w8a8 | Qualcomm® SA8255P | 32.204 ms | 2 - 180 MB | NPU
| Unet-Segmentation | TFLITE | w8a8 | Qualcomm® QCS8450 | 60.694 ms | 2 - 319 MB | NPU
| Unet-Segmentation | TFLITE | w8a8 | Qualcomm® Dragonwing™ IQ-9075 | 32.211 ms | 1 - 38 MB | NPU
| Unet-Segmentation | TFLITE | w8a8 | Qualcomm® Dragonwing™ Q-6690 | 1213.903 ms | 0 - 519 MB | NPU
| Unet-Segmentation | TFLITE | w8a8 | Qualcomm® Dragonwing™ Q-7790 | 78.724 ms | 1 - 270 MB | NPU
| Unet-Segmentation | TFLITE | w8a8 | Qualcomm® Dragonwing™ Q-8750 | 21.596 ms | 2 - 189 MB | NPU
| Unet-Segmentation | TFLITE | w8a8 | Qualcomm® SA7255P | 121.558 ms | 2 - 181 MB | NPU
| Unet-Segmentation | TFLITE | w8a8 | Qualcomm® SA8295P | 63.743 ms | 2 - 180 MB | NPU
| Unet-Segmentation | TFLITE | w8a8 | Snapdragon® 8 Elite Mobile | 21.596 ms | 2 - 189 MB | NPU
| Unet-Segmentation | TFLITE | w8a8 | Snapdragon® 8 Elite Gen 5 Mobile | 16.061 ms | 1 - 199 MB | NPU
| Unet-Segmentation | TFLITE | w8a8 | Snapdragon® 7 Gen 4 Mobile | 78.724 ms | 1 - 270 MB | NPU
## License
* The license for the original implementation of Unet-Segmentation can be found
[here](https://github.com/milesial/Pytorch-UNet/blob/master/LICENSE).
## References
* [U-Net: Convolutional Networks for Biomedical Image Segmentation](https://arxiv.org/abs/1505.04597)
* [Source Model Implementation](https://github.com/milesial/Pytorch-UNet)
## Community
* Join [our AI Hub Slack community](https://aihub.qualcomm.com/community/slack) to collaborate, post questions and learn more about on-device AI.
* For questions or feedback please [reach out to us](mailto:ai-hub-support@qti.qualcomm.com).