From 4121f56ce16c1bb0fd3b78cadb49249b53170ef8 Mon Sep 17 00:00:00 2001 From: Oleksandr Bezdieniezhnykh Date: Sat, 28 Mar 2026 17:39:53 +0200 Subject: [PATCH] [AZ-171] Remove unused onnx_batch config, add macOS skip for CoreML tests Made-with: Cursor --- config.test.yaml | 1 - config.yaml | 1 - src/constants.py | 1 - src/exports.py | 5 +---- tests/test_export.py | 2 ++ 5 files changed, 3 insertions(+), 7 deletions(-) diff --git a/config.test.yaml b/config.test.yaml index 7082f30..4544dfd 100644 --- a/config.test.yaml +++ b/config.test.yaml @@ -8,4 +8,3 @@ training: export: onnx_imgsz: 320 - onnx_batch: 1 diff --git a/config.yaml b/config.yaml index 10da702..b83fb31 100644 --- a/config.yaml +++ b/config.yaml @@ -27,4 +27,3 @@ training: export: onnx_imgsz: 1280 - onnx_batch: 4 diff --git a/src/constants.py b/src/constants.py index 1a6b74c..d880ea6 100644 --- a/src/constants.py +++ b/src/constants.py @@ -38,7 +38,6 @@ class TrainingConfig(BaseModel): class ExportConfig(BaseModel): onnx_imgsz: int = 1280 - onnx_batch: int = 4 class Config(BaseModel): diff --git a/src/exports.py b/src/exports.py index 72abc2d..a4c5487 100644 --- a/src/exports.py +++ b/src/exports.py @@ -25,9 +25,7 @@ def export_rknn(model_path): pass -def export_onnx(model_path, batch_size=None): - if batch_size is None: - batch_size = constants.config.export.onnx_batch +def export_onnx(model_path): model = YOLO(model_path) onnx_path = Path(model_path).stem + '.onnx' if path.exists(onnx_path): @@ -36,7 +34,6 @@ def export_onnx(model_path, batch_size=None): model.export( format="onnx", imgsz=constants.config.export.onnx_imgsz, - batch=batch_size, dynamic=True, simplify=True, nms=True, diff --git a/tests/test_export.py b/tests/test_export.py index bb91e01..4a3fc52 100644 --- a/tests/test_export.py +++ b/tests/test_export.py @@ -1,3 +1,4 @@ +import sys from pathlib import Path import cv2 @@ -92,6 +93,7 @@ class TestOnnxExport: assert out[0].shape[0] == 4 +@pytest.mark.skipif(sys.platform != "darwin", reason="CoreML requires macOS") class TestCoremlExport: def test_coreml_package_created(self, exported_models): # Assert