mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-10-11 00:33:45 +08:00
33d5cfc393
date: 2025-12-18T23:23:16 master commit: 3cdee7b54718ee14bd85befd6c5bad3d699c5479
14 lines
424 B
Python
14 lines
424 B
Python
#!/usr/bin/env python3
|
|
import os
|
|
from ultralytics import YOLO
|
|
from pathlib import Path
|
|
from tinygrad.nn.onnx import OnnxRunner
|
|
from extra.onnx_helpers import get_example_inputs
|
|
|
|
os.chdir("/tmp")
|
|
if not Path("yolov8n-seg.onnx").is_file():
|
|
model = YOLO("yolov8n-seg.pt")
|
|
model.export(format="onnx", imgsz=[480,640])
|
|
run_onnx = OnnxRunner("yolov8n-seg.onnx")
|
|
run_onnx(get_example_inputs(run_onnx.graph_inputs), debug=True)
|