Skip to content

Commit

Permalink
Merge pull request #3767 from eugene123tw/eugene/improve-yolox-tiny-t…
Browse files Browse the repository at this point in the history
…ile-recipe

Improve yolox-tiny tile recipe
  • Loading branch information
eugene123tw authored Aug 1, 2024
2 parents f3c1da1 + e4a32eb commit 106e425
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/otx/algo/detection/yolox.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -113,7 +114,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)

Expand Down
6 changes: 0 additions & 6 deletions src/otx/recipe/detection/yolox_tiny_tile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/algo/detection/test_yolox.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_init(self) -> None:

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.tile_image_size == (1, 3, 640, 640)

def test_exporter(self) -> None:
otx_yolox_l = YOLOXL(label_info=3)
Expand Down

0 comments on commit 106e425

Please sign in to comment.