Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
eunwoosh committed Jul 24, 2024
1 parent 2385183 commit 080932b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ All notable changes to this project will be documented in this file.

- Enable to override data configurations
(<https://github.com/openvinotoolkit/training_extensions/pull/3748>)
- Enable to use input_size at transforms in reipce
- Enable to use input_size at transforms in recipe
(<https://github.com/openvinotoolkit/training_extensions/pull/3759>)

### Bug fixes
Expand Down
5 changes: 3 additions & 2 deletions src/otx/core/data/transform_libs/torchvision.py
Original file line number Diff line number Diff line change
Expand Up @@ -3122,9 +3122,10 @@ def generate(cls, config: SubsetConfig) -> Compose:
if isinstance(config.transforms, Compose):
return config.transforms

input_size = getattr(config, "input_size", None)
transforms = []
for cfg_transform in config.transforms:
if (input_size := getattr(config, "input_size", None)) is not None:
if input_size is not None:
cls._configure_input_size(cfg_transform, input_size)
transform = cls._dispatch_transform(cfg_transform)
transforms.append(transform)
Expand Down Expand Up @@ -3164,7 +3165,7 @@ def check_type(value: Any, expected_type: Any) -> bool: # noqa: ANN401
available_types = typing.get_type_hints(model_cls.__init__).get(key)
if available_types is None or check_type(_input_size, available_types): # pass tuple[int, int]
cfg_transform["init_args"][key] = cls._eval_input_size_str(
val.replace("$(input_size)", f"({','.join(str(val) for val in _input_size)})"),
val.replace("$(input_size)", str(_input_size)),
)
elif check_type(_input_size[0], available_types): # pass int
cfg_transform["init_args"][key] = cls._eval_input_size_str(val.replace("$(input_size)", str(_input_size[0])))
Expand Down

0 comments on commit 080932b

Please sign in to comment.