INNER CODE UNIT · Python

export_one

ultralytics/yolo-flutter-app · scripts/export-tflite-models.py:181

def export_one(model_id: str, imgsz: int, output_dir: Path) -> None:
    """Export one YOLO model to w8a32 LiteRT (no calibration data required)."""
    from ultralytics import YOLO

    os.chdir(output_dir)
    YOLO(output_dir / f"{model_id}.pt").export(
        format="litert",
        quantize=QUANTIZE,
        nms=None,
        imgsz=imgsz,
        batch=1,
    )


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",

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…