24 lines
555 B
Python
24 lines
555 B
Python
import argparse
|
|
|
|
from ultralytics import YOLO
|
|
|
|
|
|
def main(checkpoint_path):
|
|
model = YOLO(checkpoint_path)
|
|
model.export(
|
|
format="openvino",
|
|
imgsz=(1280, 720),
|
|
dynamic=True,
|
|
simplify=True,
|
|
half=True,
|
|
workspace=0.8,
|
|
batch=1,
|
|
device="cpu"
|
|
)
|
|
|
|
if __name__ == "__main__":
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument("checkpoint_path", type=str)
|
|
args = parser.parse_args()
|
|
main(args.checkpoint_path)
|
|
# main(checkpoint_path="checkpoint/medical_sense-seg.pt") |