mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-30 19:33:45 +08:00
db0642ec47
date: 2025-12-18T23:23:16 master commit: 154c2334110373950bac1c36fc6e943cb1208326
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)
|