INNER CODE UNIT · Python
exported_tflite_path
ultralytics/yolo-flutter-app · scripts/export-tflite-models.py:195
def exported_tflite_path(output_dir: Path, model_id: str) -> Path | None:
"""Find the exported LiteRT .tflite for a model (single-file `<model_id>_w8a32.tflite`)."""
candidates = (
output_dir / f"{model_id}_{QUANTIZE}.tflite",
Path("/ultralytics/weights") / f"{model_id}_{QUANTIZE}.tflite",
)
for candidate in candidates:
if candidate.exists():
return candidate
return None
def run_export_worker(model_id: str, task: TaskSpec, output_dir: Path) -> Path:
"""Run a child export process (for memory isolation) and return the generated LiteRT .tflite path."""
command = [
sys.executable,
str(Path(__file__).resolve()),
"--output-dir",