ultralytics 8.2.27 replace onnxsim with onnxslim (#12989)

Co-authored-by: inisis <desmond.yao@buaa.edu.cn>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: inisis <46103969+inisis@users.noreply.github.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
Kayzwer 2024-06-01 01:03:34 +08:00 committed by GitHub
parent dd13707bf8
commit 8fb140688a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 27 additions and 20 deletions

View file

@ -41,6 +41,7 @@ def test_export_engine_matrix(task, dynamic, int8, half, batch):
batch=batch,
data=TASK2DATA[task],
workspace=1, # reduce workspace GB for less resource utilization during testing
simplify=True, # use 'onnxslim'
)
YOLO(file)([SOURCE] * batch, imgsz=64 if dynamic else 32) # exported model inference
Path(file).unlink() # cleanup

View file

@ -72,8 +72,10 @@ def test_export_openvino_matrix(task, dynamic, int8, half, batch):
@pytest.mark.slow
@pytest.mark.parametrize("task, dynamic, int8, half, batch", product(TASKS, [True, False], [False], [False], [1, 2]))
def test_export_onnx_matrix(task, dynamic, int8, half, batch):
@pytest.mark.parametrize(
"task, dynamic, int8, half, batch, simplify", product(TASKS, [True, False], [False], [False], [1, 2], [True, False])
)
def test_export_onnx_matrix(task, dynamic, int8, half, batch, simplify):
"""Test YOLO exports to ONNX format."""
file = YOLO(TASK2MODEL[task]).export(
format="onnx",
@ -82,6 +84,7 @@ def test_export_onnx_matrix(task, dynamic, int8, half, batch):
int8=int8,
half=half,
batch=batch,
simplify=simplify,
)
YOLO(file)([SOURCE] * batch, imgsz=64 if dynamic else 32) # exported model inference
Path(file).unlink() # cleanup