Remove pandas from exports table (#16371)
Signed-off-by: UltralyticsAssistant <web@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
e24a6f3b05
commit
5024bcac9d
3 changed files with 6 additions and 8 deletions
|
|
@ -95,9 +95,7 @@ from ultralytics.utils.torch_utils import TORCH_1_13, get_latest_opset, select_d
|
||||||
|
|
||||||
|
|
||||||
def export_formats():
|
def export_formats():
|
||||||
"""YOLOv8 export formats."""
|
"""Ultralytics YOLO export formats."""
|
||||||
import pandas # scope for faster 'import ultralytics'
|
|
||||||
|
|
||||||
x = [
|
x = [
|
||||||
["PyTorch", "-", ".pt", True, True],
|
["PyTorch", "-", ".pt", True, True],
|
||||||
["TorchScript", "torchscript", ".torchscript", True, True],
|
["TorchScript", "torchscript", ".torchscript", True, True],
|
||||||
|
|
@ -113,7 +111,7 @@ def export_formats():
|
||||||
["PaddlePaddle", "paddle", "_paddle_model", True, True],
|
["PaddlePaddle", "paddle", "_paddle_model", True, True],
|
||||||
["NCNN", "ncnn", "_ncnn_model", True, True],
|
["NCNN", "ncnn", "_ncnn_model", True, True],
|
||||||
]
|
]
|
||||||
return pandas.DataFrame(x, columns=["Format", "Argument", "Suffix", "CPU", "GPU"])
|
return dict(zip(["Format", "Argument", "Suffix", "CPU", "GPU"], zip(*x)))
|
||||||
|
|
||||||
|
|
||||||
def gd_outputs(gd):
|
def gd_outputs(gd):
|
||||||
|
|
|
||||||
|
|
@ -398,8 +398,8 @@ class AutoBackend(nn.Module):
|
||||||
from ultralytics.engine.exporter import export_formats
|
from ultralytics.engine.exporter import export_formats
|
||||||
|
|
||||||
raise TypeError(
|
raise TypeError(
|
||||||
f"model='{w}' is not a supported model format. "
|
f"model='{w}' is not a supported model format. Ultralytics supports: {export_formats()['Format']}\n"
|
||||||
f"See https://docs.ultralytics.com/modes/predict for help.\n\n{export_formats()}"
|
f"See https://docs.ultralytics.com/modes/predict for help."
|
||||||
)
|
)
|
||||||
|
|
||||||
# Load external metadata YAML
|
# Load external metadata YAML
|
||||||
|
|
@ -653,7 +653,7 @@ class AutoBackend(nn.Module):
|
||||||
"""
|
"""
|
||||||
from ultralytics.engine.exporter import export_formats
|
from ultralytics.engine.exporter import export_formats
|
||||||
|
|
||||||
sf = list(export_formats().Suffix) # export suffixes
|
sf = export_formats()["Suffix"] # export suffixes
|
||||||
if not is_url(p) and not isinstance(p, str):
|
if not is_url(p) and not isinstance(p, str):
|
||||||
check_suffix(p, sf) # checks
|
check_suffix(p, sf) # checks
|
||||||
name = Path(p).name
|
name = Path(p).name
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ def benchmark(
|
||||||
|
|
||||||
y = []
|
y = []
|
||||||
t0 = time.time()
|
t0 = time.time()
|
||||||
for i, (name, format, suffix, cpu, gpu) in export_formats().iterrows(): # index, (name, format, suffix, CPU, GPU)
|
for i, (name, format, suffix, cpu, gpu) in enumerate(zip(*export_formats().values())):
|
||||||
emoji, filename = "❌", None # export defaults
|
emoji, filename = "❌", None # export defaults
|
||||||
try:
|
try:
|
||||||
# Checks
|
# Checks
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue