Skip to content

Commit

Permalink
Move classification unit tests to OTX tests (#1932)
Browse files Browse the repository at this point in the history
* [CI] Updated daily workflow (#1904)

Updated daily workflow

- remove if statement to allow running on any branch by manually

* [FIX] re-bugfix: ATSS head loss (#1907)

re bugfix

* Added security.md

Added the security related notification.

* Update security.md

fix prettier issue

* Move classification unit tests

* Apply mocker in RandAugment TC

---------

Co-authored-by: Yunchu Lee <yunchu.lee@intel.com>
Co-authored-by: Eunwoo Shin <eunwoo.shin@intel.com>
  • Loading branch information
3 people authored Mar 23, 2023
1 parent d9ec6ad commit 28b9341
Show file tree
Hide file tree
Showing 25 changed files with 17 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""Test for otx.algorithms.classification.adapters.mmcls.models.losses."""
# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Test for otx.mpa.modules.models"""

"""Test for otx.algorithms.classification.adapters.mmcls.optimizer"""
# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Test for otx.mpa.modules.models.classifiers"""

"""Test for otx.algorithms.common.adapters.mmcv.pipelines"""
# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
"""Test for otx.algorithms.common.adapters.mmcv.pipelines.transforms"""
# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Unit Tests for the MPA Dataset Pipelines OTE Transforms."""
"""Unit Tests for the OTX Dataset Pipelines OTX Transforms."""

# Copyright (C) 2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,9 @@ def test_cutoutabs_transform(sample_pil_image: Image.Image) -> None:


class TestOTXRandAugment:
def test_with_default_arguments(self, sample_np_image: np.ndarray) -> None:
def test_with_default_arguments(self, mocker, sample_np_image: np.ndarray) -> None:
"""Test case with default arguments."""
mocker.patch("random.random", return_value=0.1) # RandAugment is applied only when random.random() < 0.5
transform = OTXRandAugment(num_aug=2, magnitude=5, cutout_value=16)
data = {"img": sample_np_image}
results = transform(data)
Expand All @@ -54,8 +55,9 @@ def test_with_default_arguments(self, sample_np_image: np.ndarray) -> None:
assert any(item.startswith("rand_mc_") for item in results.keys())
assert "CutoutAbs" in results

def test_with_img_fields_argument(self, sample_np_image: np.ndarray) -> None:
def test_with_img_fields_argument(self, mocker, sample_np_image: np.ndarray) -> None:
"""Test case with img_fields argument."""
mocker.patch("random.random", return_value=0.1) # RandAugment is applied only when random.random() < 0.5
transform = OTXRandAugment(num_aug=2, magnitude=5, cutout_value=16)
data = {
"img1": sample_np_image,
Expand Down
4 changes: 0 additions & 4 deletions tests/unit/mpa/modules/datasets/pipelines/__init__.py

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions tests/unit/mpa/modules/heads/__init__.py

This file was deleted.

4 changes: 0 additions & 4 deletions tests/unit/mpa/modules/optimizer/__init__.py

This file was deleted.

0 comments on commit 28b9341

Please sign in to comment.