Android segmentation deployment workflow
You will use this workflow:
- Prepare LR-ASPP MobileNetV3 weights, labels, sample image, and input and output specifications.
- Export and lower the FP32 model to ExecuTorch with XNNPACK.
- Validate the FP32 cutout locally and record the baseline mask quality.
- Calibrate, quantize, and lower the model to INT8 with XNNPACK.
- Validate the INT8 cutout locally and compare it with the FP32 baseline.
- Package the INT8
.pte, labels, and model specification as Android assets. - Run the Android object-cutout app on an emulator or physical device.
- Inspect how the Java app loads assets, creates tensors, calls ExecuTorch, and postprocesses the output.
By the end of the workflow, you should have FP32 and INT8 .pte artifacts, local FP32 and INT8 cutout images, Android app output, and timing measurements.
Script layout
The repository separates model preparation from Android integration:
aot Model preparation, export, lowering, calibration, quantization, and validation
android Android asset synchronization
android/ObjectCutout Java Android Gradle project
artifacts Generated model files and validation images
Development and target environments
| Environment | Responsibility | Main outputs |
|---|---|---|
| Development machine | Prepare LR-ASPP, export, lower, quantize, validate FP32 and INT8 cutouts | .pte artifacts, model_spec.json, labels, validation images |
| Android emulator or physical Android phone | Check the build, asset loading, image selection, cutout output, and UI responsiveness | Cutout and highlight output; stage timings on a physical device |
Course complete
Nice work
You completed Optimize and deploy AI inference with ExecuTorch on Arm.