Skip to content

Commit

Permalink
✅ [Pass] test on new framework and file name
Browse files Browse the repository at this point in the history
  • Loading branch information
henrytsui000 committed Jun 2, 2024
1 parent dcceddd commit a0cddf7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tests/test_tools/test_module_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

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


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


def test_get_activation_invalid():
with pytest.raises(ValueError):
get_activation("unsupported_activation")
create_activation_function("unsupported_activation")
9 changes: 7 additions & 2 deletions tests/test_utils/test_dataaugment.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))

from yolo.utils.data_augmentation import Compose, HorizontalFlip, Mosaic, VerticalFlip
from yolo.tools.data_augmentation import (
AugmentationComposer,
HorizontalFlip,
Mosaic,
VerticalFlip,
)


def test_horizontal_flip():
Expand All @@ -33,7 +38,7 @@ def test_compose():
def mock_transform(image, boxes):
return image, boxes

compose = Compose([mock_transform, mock_transform])
compose = AugmentationComposer([mock_transform, mock_transform])
img = Image.new("RGB", (10, 10), color="blue")
boxes = torch.tensor([[0, 0.2, 0.2, 0.8, 0.8]])

Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils/test_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
project_root = Path(__file__).resolve().parent.parent.parent
sys.path.append(str(project_root))

from yolo.utils.loss_functions import YOLOLoss
from yolo.tools.loss_functions import YOLOLoss


@pytest.fixture
Expand Down

0 comments on commit a0cddf7

Please sign in to comment.