--- library_name: pytorch license: other tags: - android pipeline_tag: image-to-image --- ![](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/aotgan/web-assets/model_demo.png) # AOT-GAN: Optimized for Qualcomm Devices AOT-GAN is a machine learning model that allows to erase and in-paint part of given input image. This is based on the implementation of AOT-GAN found [here](https://github.com/researchmm/AOT-GAN-for-Inpainting). 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/main/src/qai_hub_models/models/aotgan) 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.42, ONNX Runtime 1.24.3 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/aotgan/releases/v0.52.0/aotgan-onnx-float.zip) | QNN_DLC | float | Universal | QAIRT 2.45 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/aotgan/releases/v0.52.0/aotgan-qnn_dlc-float.zip) | TFLITE | float | Universal | QAIRT 2.45 | [Download](https://qaihub-public-assets.s3.us-west-2.amazonaws.com/qai-hub-models/models/aotgan/releases/v0.52.0/aotgan-tflite-float.zip) For more device-specific assets and performance metrics, visit **[AOT-GAN on Qualcomm® AI Hub](https://aihub.qualcomm.com/models/aotgan)**. ### Option 2: Export with Custom Configurations Use the [Qualcomm® AI Hub Models](https://github.com/qualcomm/ai-hub-models/blob/main/src/qai_hub_models/models/aotgan) 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 [AOT-GAN on GitHub](https://github.com/qualcomm/ai-hub-models/blob/main/src/qai_hub_models/models/aotgan) for usage instructions. ## Model Details **Model Type:** Model_use_case.image_editing **Model Stats:** - Model checkpoint: CelebAHQ - Input resolution: 512x512 - Number of parameters: 15.2M - Model size (float): 58.0 MB ## Performance Summary | Model | Runtime | Precision | Chipset | Inference Time (ms) | Peak Memory Range (MB) | Primary Compute Unit |---|---|---|---|---|---|--- | AOT-GAN | ONNX | float | Snapdragon® 8 Elite Gen 5 Mobile | 58.425 ms | 10 - 503 MB | NPU | AOT-GAN | ONNX | float | Snapdragon® X2 Elite | 61.634 ms | 32 - 32 MB | NPU | AOT-GAN | ONNX | float | Snapdragon® X Elite | 149.337 ms | 31 - 31 MB | NPU | AOT-GAN | ONNX | float | Snapdragon® 8 Gen 3 Mobile | 102.64 ms | 11 - 761 MB | NPU | AOT-GAN | ONNX | float | Qualcomm® QCS8550 (Proxy) | 144.849 ms | 0 - 38 MB | NPU | AOT-GAN | ONNX | float | Qualcomm® QCS9075 | 226.001 ms | 4 - 11 MB | NPU | AOT-GAN | ONNX | float | Snapdragon® 8 Elite For Galaxy Mobile | 77.984 ms | 9 - 634 MB | NPU | AOT-GAN | QNN_DLC | float | Snapdragon® 8 Elite Gen 5 Mobile | 47.453 ms | 4 - 491 MB | NPU | AOT-GAN | QNN_DLC | float | Snapdragon® X2 Elite | 51.785 ms | 4 - 4 MB | NPU | AOT-GAN | QNN_DLC | float | Snapdragon® X Elite | 122.695 ms | 4 - 4 MB | NPU | AOT-GAN | QNN_DLC | float | Snapdragon® 8 Gen 3 Mobile | 88.701 ms | 1 - 689 MB | NPU | AOT-GAN | QNN_DLC | float | Qualcomm® QCS8275 (Proxy) | 543.807 ms | 1 - 541 MB | NPU | AOT-GAN | QNN_DLC | float | Qualcomm® QCS8550 (Proxy) | 119.933 ms | 4 - 7 MB | NPU | AOT-GAN | QNN_DLC | float | Qualcomm® SA8775P | 162.153 ms | 1 - 540 MB | NPU | AOT-GAN | QNN_DLC | float | Qualcomm® QCS9075 | 214.945 ms | 4 - 13 MB | NPU | AOT-GAN | QNN_DLC | float | Qualcomm® QCS8450 (Proxy) | 199.68 ms | 2 - 609 MB | NPU | AOT-GAN | QNN_DLC | float | Qualcomm® SA7255P | 543.807 ms | 1 - 541 MB | NPU | AOT-GAN | QNN_DLC | float | Qualcomm® SA8295P | 179.491 ms | 1 - 478 MB | NPU | AOT-GAN | QNN_DLC | float | Snapdragon® 8 Elite For Galaxy Mobile | 69.069 ms | 1 - 578 MB | NPU | AOT-GAN | TFLITE | float | Snapdragon® 8 Elite Gen 5 Mobile | 46.72 ms | 2 - 506 MB | NPU | AOT-GAN | TFLITE | float | Snapdragon® 8 Gen 3 Mobile | 88.89 ms | 0 - 721 MB | NPU | AOT-GAN | TFLITE | float | Qualcomm® QCS8275 (Proxy) | 541.191 ms | 3 - 558 MB | NPU | AOT-GAN | TFLITE | float | Qualcomm® QCS8550 (Proxy) | 116.855 ms | 3 - 7 MB | NPU | AOT-GAN | TFLITE | float | Qualcomm® SA8775P | 161.574 ms | 3 - 558 MB | NPU | AOT-GAN | TFLITE | float | Qualcomm® QCS9075 | 210.953 ms | 2 - 45 MB | NPU | AOT-GAN | TFLITE | float | Qualcomm® QCS8450 (Proxy) | 200.608 ms | 3 - 633 MB | NPU | AOT-GAN | TFLITE | float | Qualcomm® SA7255P | 541.191 ms | 3 - 558 MB | NPU | AOT-GAN | TFLITE | float | Qualcomm® SA8295P | 178.63 ms | 3 - 493 MB | NPU | AOT-GAN | TFLITE | float | Snapdragon® 8 Elite For Galaxy Mobile | 69.172 ms | 3 - 596 MB | NPU ## License * The license for the original implementation of AOT-GAN can be found [here](https://github.com/taki0112/AttnGAN-Tensorflow/blob/master/LICENSE). ## References * [Aggregated Contextual Transformations for High-Resolution Image Inpainting](https://arxiv.org/abs/2104.01431) * [Source Model Implementation](https://github.com/researchmm/AOT-GAN-for-Inpainting) ## 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).