From 87c2ec26eecb9ecaf22631129b30638c94f3b0ab Mon Sep 17 00:00:00 2001 From: Eugene Liu Date: Thu, 25 Jul 2024 11:28:43 +0100 Subject: [PATCH 1/5] update yolox-tiny tile recipe --- src/otx/recipe/detection/yolox_tiny_tile.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/otx/recipe/detection/yolox_tiny_tile.yaml b/src/otx/recipe/detection/yolox_tiny_tile.yaml index 768f96c4dbc..61d9d59f765 100644 --- a/src/otx/recipe/detection/yolox_tiny_tile.yaml +++ b/src/otx/recipe/detection/yolox_tiny_tile.yaml @@ -70,9 +70,6 @@ overrides: std: [58.395, 57.12, 57.375] val_subset: - input_size: - - 416 - - 416 num_workers: 4 batch_size: 8 transforms: @@ -93,9 +90,6 @@ overrides: std: [58.395, 57.12, 57.375] test_subset: - input_size: - - 416 - - 416 num_workers: 4 batch_size: 8 transforms: From 6d57e9f36a2ee43c890e382eb956a9c80b8bc7a4 Mon Sep 17 00:00:00 2001 From: Eugene Liu Date: Tue, 30 Jul 2024 10:26:06 +0100 Subject: [PATCH 2/5] update yolox-tiny tile image size --- src/otx/algo/detection/yolox.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/otx/algo/detection/yolox.py b/src/otx/algo/detection/yolox.py index 38acf96438f..f50d0b3a7da 100644 --- a/src/otx/algo/detection/yolox.py +++ b/src/otx/algo/detection/yolox.py @@ -113,7 +113,7 @@ class YOLOXTINY(YOLOX): "openvino_training_extensions/models/object_detection/v2/yolox_tiny_8x8.pth" ) image_size = (1, 3, 416, 416) - tile_image_size = (1, 3, 416, 416) + tile_image_size = (1, 3, 640, 640) mean = (123.675, 116.28, 103.53) std = (58.395, 57.12, 57.375) From 74c3c33e6c73fc71e9bf785440b7a3d3fbd8ba97 Mon Sep 17 00:00:00 2001 From: Eugene Liu Date: Tue, 30 Jul 2024 14:34:25 +0100 Subject: [PATCH 3/5] update yolox-tiny recipe --- src/otx/algo/detection/yolox.py | 2 +- src/otx/recipe/detection/yolox_tiny.yaml | 8 ++++---- tests/unit/algo/detection/test_yolox.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/otx/algo/detection/yolox.py b/src/otx/algo/detection/yolox.py index f50d0b3a7da..c90760562ab 100644 --- a/src/otx/algo/detection/yolox.py +++ b/src/otx/algo/detection/yolox.py @@ -112,7 +112,7 @@ class YOLOXTINY(YOLOX): "https://storage.openvinotoolkit.org/repositories/" "openvino_training_extensions/models/object_detection/v2/yolox_tiny_8x8.pth" ) - image_size = (1, 3, 416, 416) + image_size = (1, 3, 640, 640) tile_image_size = (1, 3, 640, 640) mean = (123.675, 116.28, 103.53) std = (58.395, 57.12, 57.375) diff --git a/src/otx/recipe/detection/yolox_tiny.yaml b/src/otx/recipe/detection/yolox_tiny.yaml index 9950a427274..ddb99fd8094 100644 --- a/src/otx/recipe/detection/yolox_tiny.yaml +++ b/src/otx/recipe/detection/yolox_tiny.yaml @@ -77,8 +77,8 @@ overrides: val_subset: input_size: - - 416 - - 416 + - 640 + - 640 batch_size: 8 transforms: - class_path: otx.core.data.transform_libs.torchvision.Resize @@ -100,8 +100,8 @@ overrides: test_subset: input_size: - - 416 - - 416 + - 640 + - 640 batch_size: 8 transforms: - class_path: otx.core.data.transform_libs.torchvision.Resize diff --git a/tests/unit/algo/detection/test_yolox.py b/tests/unit/algo/detection/test_yolox.py index b83d0cae71b..66dbfa4dbcb 100644 --- a/tests/unit/algo/detection/test_yolox.py +++ b/tests/unit/algo/detection/test_yolox.py @@ -22,8 +22,8 @@ def test_init(self) -> None: assert otx_yolox_l.tile_image_size == (1, 3, 640, 640) otx_yolox_tiny = YOLOXTINY(label_info=3) - assert otx_yolox_tiny.image_size == (1, 3, 416, 416) - assert otx_yolox_tiny.tile_image_size == (1, 3, 416, 416) + assert otx_yolox_tiny.image_size == (1, 3, 640, 640) + assert otx_yolox_tiny.tile_image_size == (1, 3, 640, 640) def test_exporter(self) -> None: otx_yolox_l = YOLOXL(label_info=3) From ca432cd2cdc4f24cd83628ef3f9d25e139169346 Mon Sep 17 00:00:00 2001 From: Eugene Liu Date: Wed, 31 Jul 2024 09:35:46 +0100 Subject: [PATCH 4/5] update yolox-tiny input size --- src/otx/algo/detection/yolox.py | 2 +- src/otx/recipe/detection/yolox_tiny.yaml | 8 ++++---- tests/unit/algo/detection/test_yolox.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/otx/algo/detection/yolox.py b/src/otx/algo/detection/yolox.py index c90760562ab..f50d0b3a7da 100644 --- a/src/otx/algo/detection/yolox.py +++ b/src/otx/algo/detection/yolox.py @@ -112,7 +112,7 @@ class YOLOXTINY(YOLOX): "https://storage.openvinotoolkit.org/repositories/" "openvino_training_extensions/models/object_detection/v2/yolox_tiny_8x8.pth" ) - image_size = (1, 3, 640, 640) + image_size = (1, 3, 416, 416) tile_image_size = (1, 3, 640, 640) mean = (123.675, 116.28, 103.53) std = (58.395, 57.12, 57.375) diff --git a/src/otx/recipe/detection/yolox_tiny.yaml b/src/otx/recipe/detection/yolox_tiny.yaml index ddb99fd8094..9950a427274 100644 --- a/src/otx/recipe/detection/yolox_tiny.yaml +++ b/src/otx/recipe/detection/yolox_tiny.yaml @@ -77,8 +77,8 @@ overrides: val_subset: input_size: - - 640 - - 640 + - 416 + - 416 batch_size: 8 transforms: - class_path: otx.core.data.transform_libs.torchvision.Resize @@ -100,8 +100,8 @@ overrides: test_subset: input_size: - - 640 - - 640 + - 416 + - 416 batch_size: 8 transforms: - class_path: otx.core.data.transform_libs.torchvision.Resize diff --git a/tests/unit/algo/detection/test_yolox.py b/tests/unit/algo/detection/test_yolox.py index 66dbfa4dbcb..911720a7a0a 100644 --- a/tests/unit/algo/detection/test_yolox.py +++ b/tests/unit/algo/detection/test_yolox.py @@ -22,7 +22,7 @@ def test_init(self) -> None: assert otx_yolox_l.tile_image_size == (1, 3, 640, 640) otx_yolox_tiny = YOLOXTINY(label_info=3) - assert otx_yolox_tiny.image_size == (1, 3, 640, 640) + assert otx_yolox_tiny.image_size == (1, 3, 416, 416) assert otx_yolox_tiny.tile_image_size == (1, 3, 640, 640) def test_exporter(self) -> None: From e4a32eb65beddf635b5853573678b0159768ee4f Mon Sep 17 00:00:00 2001 From: Eugene Liu Date: Wed, 31 Jul 2024 17:54:11 +0100 Subject: [PATCH 5/5] update exporter tile image size --- src/otx/algo/detection/yolox.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/otx/algo/detection/yolox.py b/src/otx/algo/detection/yolox.py index f50d0b3a7da..d7af5f7a806 100644 --- a/src/otx/algo/detection/yolox.py +++ b/src/otx/algo/detection/yolox.py @@ -44,10 +44,11 @@ def _exporter(self) -> OTXModelExporter: raise ValueError(self.image_size) swap_rgb = not isinstance(self, YOLOXTINY) # only YOLOX-TINY uses RGB + input_size = self.tile_image_size if self.tile_config.enable_tiler else self.image_size return OTXNativeModelExporter( task_level_export_parameters=self._export_parameters, - input_size=self.image_size, + input_size=input_size, mean=self.mean, std=self.std, resize_mode="fit_to_window_letterbox",