mirror of
https://github.com/THU-MIG/yolov10.git
synced 2025-05-23 05:24:22 +08:00
use yolov10 by default in cli
This commit is contained in:
parent
dfed201384
commit
e5f2f03c55
@ -8,6 +8,7 @@ import sys
|
||||
from pathlib import Path
|
||||
from types import SimpleNamespace
|
||||
from typing import Dict, List, Union
|
||||
import re
|
||||
|
||||
from ultralytics.utils import (
|
||||
ASSETS,
|
||||
@ -551,7 +552,11 @@ def entrypoint(debug=""):
|
||||
from ultralytics import SAM
|
||||
|
||||
model = SAM(model)
|
||||
elif "yolov10" in stem:
|
||||
elif re.search("v3|v5|v6|v8|v9", stem):
|
||||
from ultralytics import YOLO
|
||||
|
||||
model = YOLO(model, task=task)
|
||||
else:
|
||||
from ultralytics import YOLOv10
|
||||
|
||||
# Special case for the HuggingFace Hub
|
||||
@ -560,10 +565,6 @@ def entrypoint(debug=""):
|
||||
model = YOLOv10.from_pretrained(model)
|
||||
else:
|
||||
model = YOLOv10(model)
|
||||
else:
|
||||
from ultralytics import YOLO
|
||||
|
||||
model = YOLO(model, task=task)
|
||||
if isinstance(overrides.get("pretrained"), str):
|
||||
model.load(overrides["pretrained"])
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user