Skip to content

Commit a0cddf7

Browse files
committed
✅ [Pass] test on new framework and file name
1 parent dcceddd commit a0cddf7

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

tests/test_tools/test_module_helper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
project_root = Path(__file__).resolve().parent.parent.parent
99
sys.path.append(str(project_root))
10-
from yolo.tools.module_helper import auto_pad, get_activation
10+
from yolo.utils.module_utils import auto_pad, create_activation_function
1111

1212

1313
@pytest.mark.parametrize(
@@ -29,10 +29,10 @@ def test_auto_pad(kernel_size, dilation, expected):
2929
[("ReLU", nn.ReLU), ("leakyrelu", nn.LeakyReLU), ("none", nn.Identity), (None, nn.Identity), (False, nn.Identity)],
3030
)
3131
def test_get_activation(activation_name, expected_type):
32-
result = get_activation(activation_name)
32+
result = create_activation_function(activation_name)
3333
assert isinstance(result, expected_type), f"get_activation does not return correct type for {activation_name}"
3434

3535

3636
def test_get_activation_invalid():
3737
with pytest.raises(ValueError):
38-
get_activation("unsupported_activation")
38+
create_activation_function("unsupported_activation")

tests/test_utils/test_dataaugment.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99
project_root = Path(__file__).resolve().parent.parent.parent
1010
sys.path.append(str(project_root))
1111

12-
from yolo.utils.data_augmentation import Compose, HorizontalFlip, Mosaic, VerticalFlip
12+
from yolo.tools.data_augmentation import (
13+
AugmentationComposer,
14+
HorizontalFlip,
15+
Mosaic,
16+
VerticalFlip,
17+
)
1318

1419

1520
def test_horizontal_flip():
@@ -33,7 +38,7 @@ def test_compose():
3338
def mock_transform(image, boxes):
3439
return image, boxes
3540

36-
compose = Compose([mock_transform, mock_transform])
41+
compose = AugmentationComposer([mock_transform, mock_transform])
3742
img = Image.new("RGB", (10, 10), color="blue")
3843
boxes = torch.tensor([[0, 0.2, 0.2, 0.8, 0.8]])
3944

tests/test_utils/test_loss.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
project_root = Path(__file__).resolve().parent.parent.parent
99
sys.path.append(str(project_root))
1010

11-
from yolo.utils.loss_functions import YOLOLoss
11+
from yolo.tools.loss_functions import YOLOLoss
1212

1313

1414
@pytest.fixture

0 commit comments

Comments
 (0)