Skip to content

Latest commit

 

History

History
49 lines (31 loc) · 1.8 KB

File metadata and controls

49 lines (31 loc) · 1.8 KB

EfficientSAM Model Export

This example demonstrates how to export the EfficientSAM model to Core ML and XNNPACK using ExecuTorch.

Instructions

1. Setup

Follow the tutorial to set up ExecuTorch.

2. Exports

Exporting to Core ML

Make sure to install the required dependencies for Core ML export.

To export the model to Core ML, run the following command:

cd executorch
python -m examples.apple.coreml.scripts.export -m efficient_sam

Exporting to XNNPACK

To export the model to XNNPACK, run the following command:

cd executorch
python -m examples.xnnpack.aot_compiler -m efficient_sam

Performance

Tests were conducted on an Apple M1 Pro chip using the instructions for building and running Executorch with Core ML and XNNPACK backends.

Backend Configuration Average Inference Time (seconds)
Core ML (CPU, GPU, NE) 34.8
Core ML (CPU, GPU) 34.7
Core ML (CPU, NE) 26.4
Core ML (CPU) 22.8
XNNPACK 4.1

All models were tested with float32 precision.

Licensing

The code in the efficient_sam_core directory is licensed under the Apache License 2.0.