(payload: ExportRequest)
| 1267 | |
| 1268 | @app.post("/api/export") |
| 1269 | def api_export(payload: ExportRequest) -> dict[str, Any]: |
| 1270 | from ultralytics import YOLO |
| 1271 | model_path = _export_model_path(payload.model_name) |
| 1272 | params = _export_params(payload) |
| 1273 | try: |
| 1274 | exported = YOLO(str(model_path)).export(**params) |
| 1275 | except Exception as exc: |
| 1276 | raise HTTPException(status_code=500, detail=f"Export failed: {exc}") from exc |
| 1277 | _invalidate_system_meta_cache() |
| 1278 | return {"ok": True, "message": "Model exported successfully.", "path": str(exported)} |
| 1279 | |
| 1280 | |
| 1281 | @app.post("/api/export/stream") |
nothing calls this directly
no test coverage detected