-
Notifications
You must be signed in to change notification settings - Fork 446
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4002 from openvinotoolkit/kp/merge_back_rc4_2.2.0
Back merge 2.2.0_rc4
- Loading branch information
Showing
6 changed files
with
61 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
"""Unit tests of classification datasets.""" | ||
|
||
from otx.core.data.dataset.segmentation import OTXSegmentationDataset | ||
from otx.core.data.entity.segmentation import SegDataEntity | ||
|
||
|
||
class TestOTXSegmentationDataset: | ||
def test_get_item( | ||
self, | ||
fxt_mock_dm_subset, | ||
) -> None: | ||
dataset = OTXSegmentationDataset( | ||
dm_subset=fxt_mock_dm_subset, | ||
transforms=[lambda x: x], | ||
mem_cache_img_max_size=None, | ||
max_refetch=3, | ||
) | ||
assert isinstance(dataset[0], SegDataEntity) | ||
assert "background" in [label_name.lower() for label_name in dataset.label_info.label_names] | ||
|
||
def test_get_item_from_bbox_dataset( | ||
self, | ||
fxt_mock_det_dm_subset, | ||
) -> None: | ||
dataset = OTXSegmentationDataset( | ||
dm_subset=fxt_mock_det_dm_subset, | ||
transforms=[lambda x: x], | ||
mem_cache_img_max_size=None, | ||
max_refetch=3, | ||
) | ||
assert isinstance(dataset[0], SegDataEntity) | ||
# OTXSegmentationDataset should add background when getting a dataset which includes only bbox annotations | ||
assert "background" in [label_name.lower() for label_name in dataset.label_info.label_names] |