ultralytics 8.0.35 TensorRT, ONNX and OpenVINO predict and val (#929)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Eric Pedley <ericpedley@gmail.com>
This commit is contained in:
parent
d32b339373
commit
977fd8f0b8
15 changed files with 88 additions and 69 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
import contextlib
|
||||
from copy import deepcopy
|
||||
from pathlib import Path
|
||||
|
||||
import thop
|
||||
import torch
|
||||
|
|
@ -490,6 +491,14 @@ def guess_model_task(model):
|
|||
with contextlib.suppress(Exception):
|
||||
cfg = eval(x)
|
||||
break
|
||||
elif isinstance(model, (str, Path)):
|
||||
model = str(model)
|
||||
if '-seg' in model:
|
||||
return "segment"
|
||||
elif '-cls' in model:
|
||||
return "classify"
|
||||
else:
|
||||
return "detect"
|
||||
|
||||
# Guess from YAML dictionary
|
||||
if cfg:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue