diff --git a/src/otx/algo/segmentation/backbones/litehrnet.py b/src/otx/algo/segmentation/backbones/litehrnet.py index 8de1a58bc09..7b8ffd450e1 100644 --- a/src/otx/algo/segmentation/backbones/litehrnet.py +++ b/src/otx/algo/segmentation/backbones/litehrnet.py @@ -14,7 +14,6 @@ import torch import torch.utils.checkpoint as cp -from mmengine.utils import is_tuple_of from torch import nn from torch.nn import functional @@ -153,9 +152,6 @@ def __init__( if len(act_cfg) != 2: msg = "act_cfg must be a dict or a tuple of dicts of length 2." raise ValueError(msg) - if not is_tuple_of(act_cfg, dict): - msg = "act_cfg must be a dict or a tuple of dicts." - raise TypeError(msg) self.channels = channels total_channel = sum(channels) @@ -226,9 +222,6 @@ def __init__( if len(act_cfg) != 2: msg = "act_cfg must be a dict or a tuple of dicts of length 2." raise ValueError(msg) - if not is_tuple_of(act_cfg, dict): - msg = "act_cfg must be a dict or a tuple of dicts." - raise TypeError(msg) self.global_avgpool = nn.AdaptiveAvgPool2d(1) self.conv1 = ConvModule( diff --git a/src/otx/algo/segmentation/heads/ham_head.py b/src/otx/algo/segmentation/heads/ham_head.py index 8a9f7e42bed..68c7b006cba 100644 --- a/src/otx/algo/segmentation/heads/ham_head.py +++ b/src/otx/algo/segmentation/heads/ham_head.py @@ -9,7 +9,6 @@ import torch import torch.nn.functional as f -from mmengine.device import get_device from torch import nn from otx.algo.modules import ConvModule @@ -223,7 +222,7 @@ def _build_bases( segments: int, channels: int, basis_vectors: int, - device: torch.device | None = None, + device: torch.device, ) -> torch.Tensor: """Build bases in initialization. @@ -237,8 +236,6 @@ def _build_bases( Returns: torch.Tensor: Tensor of shape (batch_size * segments, channels, basis_vectors) containing the built bases. """ - if device is None: - device = get_device() bases = torch.rand((batch_size * segments, channels, basis_vectors)).to(device) return f.normalize(bases, dim=1) diff --git a/src/otx/recipe/_base_/data/mmseg_base.yaml b/src/otx/recipe/_base_/data/mmseg_base.yaml index d6ed6336c23..55cd7c91a39 100644 --- a/src/otx/recipe/_base_/data/mmseg_base.yaml +++ b/src/otx/recipe/_base_/data/mmseg_base.yaml @@ -18,11 +18,14 @@ config: size: - 512 - 512 + scale: + - 0.2 + - 1.0 ratio: - 0.5 - 2.0 antialias: True - - class_path: torchvision.transforms.v2.RandomPhotometricDistort + - class_path: otx.core.data.transform_libs.torchvision.PhotoMetricDistortion - class_path: torchvision.transforms.v2.RandomHorizontalFlip init_args: p: 0.5 diff --git a/src/otx/recipe/semantic_segmentation/dino_v2.yaml b/src/otx/recipe/semantic_segmentation/dino_v2.yaml index 05bd298200b..a33f8eb58bb 100644 --- a/src/otx/recipe/semantic_segmentation/dino_v2.yaml +++ b/src/otx/recipe/semantic_segmentation/dino_v2.yaml @@ -80,11 +80,14 @@ overrides: size: - 560 - 560 + scale: + - 0.2 + - 1.0 ratio: - 0.5 - 2.0 antialias: True - - class_path: torchvision.transforms.v2.RandomPhotometricDistort + - class_path: otx.core.data.transform_libs.torchvision.PhotoMetricDistortion - class_path: torchvision.transforms.v2.RandomHorizontalFlip init_args: p: 0.5