Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix daily tests #3050

Merged
merged 10 commits into from
Mar 8, 2024
13 changes: 8 additions & 5 deletions src/otx/algorithms/detection/adapters/openvino/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,14 +446,17 @@
):
args.append({"resize_type": "fit_to_window_letterbox", "pad_value": 114})
inferencer: BaseInferencerWithConverter = OpenVINODetectionInferencer(*args)
if self.task_type == TaskType.INSTANCE_SEGMENTATION:
if self.config.tiling_parameters.enable_tiling:
if self.task_type == TaskType.INSTANCE_SEGMENTATION or self.task_type == TaskType.ROTATED_DETECTION:
if not self.config.tiling_parameters.enable_tiling:

Check warning on line 450 in src/otx/algorithms/detection/adapters/openvino/task.py

View check run for this annotation

Codecov / codecov/patch

src/otx/algorithms/detection/adapters/openvino/task.py#L449-L450

Added lines #L449 - L450 were not covered by tests
sovrasov marked this conversation as resolved.
Show resolved Hide resolved
args.append({"resize_type": "standard"})
else:
args.append({"resize_type": "fit_to_window_letterbox", "pad_value": 0})
eunwoosh marked this conversation as resolved.
Show resolved Hide resolved
inferencer = OpenVINOMaskInferencer(*args)
if self.task_type == TaskType.ROTATED_DETECTION:
inferencer = OpenVINORotatedRectInferencer(*args)

if self.task_type == TaskType.INSTANCE_SEGMENTATION:
inferencer = OpenVINOMaskInferencer(*args)

Check warning on line 456 in src/otx/algorithms/detection/adapters/openvino/task.py

View check run for this annotation

Codecov / codecov/patch

src/otx/algorithms/detection/adapters/openvino/task.py#L455-L456

Added lines #L455 - L456 were not covered by tests
else:
inferencer = OpenVINORotatedRectInferencer(*args)

Check warning on line 458 in src/otx/algorithms/detection/adapters/openvino/task.py

View check run for this annotation

Codecov / codecov/patch

src/otx/algorithms/detection/adapters/openvino/task.py#L458

Added line #L458 was not covered by tests

if self.config.tiling_parameters.enable_tiling:
logger.info("Tiling is enabled. Wrap inferencer with tile inference.")
tile_classifier_model_file, tile_classifier_weight_file = None, None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
img_norm_cfg = dict(mean=(103.53, 116.28, 123.675), std=(1.0, 1.0, 1.0), to_rgb=True)

train_pipeline = [
dict(type="Resize", img_scale=img_size, keep_ratio=False),
dict(type="Resize", img_scale=img_size, keep_ratio=True),
dict(type="RandomFlip", flip_ratio=0.5),
dict(type="Normalize", **img_norm_cfg),
dict(type="Pad", size_divisor=32),
Expand Down Expand Up @@ -42,7 +42,7 @@
img_scale=img_size,
flip=False,
transforms=[
dict(type="Resize", keep_ratio=False),
dict(type="Resize", keep_ratio=True),
dict(type="RandomFlip"),
dict(type="Normalize", **img_norm_cfg),
dict(type="Pad", size_divisor=32),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
with_mask=True,
poly2mask=False,
),
dict(type="Resize", img_scale=__img_size, keep_ratio=True),
dict(type="Resize", img_scale=__img_size, keep_ratio=False),
dict(type="RandomFlip", flip_ratio=0.5),
dict(type="Normalize", **__img_norm_cfg),
dict(type="Pad", size_divisor=32),
Expand Down Expand Up @@ -50,7 +50,7 @@
img_scale=__img_size,
flip=False,
transforms=[
dict(type="Resize", keep_ratio=True),
dict(type="Resize", keep_ratio=False),
dict(type="RandomFlip"),
dict(type="Normalize", **__img_norm_cfg),
dict(type="Pad", size_divisor=32),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
resize_cfg=dict(
type="Resize",
img_scale=__img_size,
keep_ratio=True,
keep_ratio=False,
),
enable_memcache=True, # Cache after resizing image & annotations
),
Expand All @@ -54,7 +54,7 @@
val_pipeline = [
dict(
type="LoadResizeDataFromOTXDataset",
resize_cfg=dict(type="Resize", img_scale=__img_size, keep_ratio=True),
resize_cfg=dict(type="Resize", img_scale=__img_size, keep_ratio=False),
enable_memcache=True, # Cache after resizing image
),
dict(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Tiling Pipeline of ConvNeXt model for Instance-Seg Task."""
"""Tiling Pipeline of SwinT model for Instance-Seg Task."""

# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/cli/anomaly/test_anomaly_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def test_otx_eval(self, template, tmp_dir_path):
@e2e_pytest_component
@pytest.mark.parametrize("template", templates, ids=templates_ids)
def test_otx_eval_openvino(self, template, tmp_dir_path):
otx_eval_openvino_testing(template, tmp_dir_path, otx_dir, args, threshold=0.2)
otx_eval_openvino_testing(template, tmp_dir_path, otx_dir, args, threshold=0.3)

@e2e_pytest_component
@pytest.mark.parametrize("template", templates, ids=templates_ids)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def test_otx_eval_openvino(self, template, tmp_dir_path, half_precision):
tmp_dir_path = tmp_dir_path / "tiling_ins_seg"
if "ResNet50" in template.name:
pytest.skip(reason="Issue#2290: MaskRCNN shows degraded performance when inferencing in OpenVINO")
otx_eval_openvino_testing(template, tmp_dir_path, otx_dir, args, threshold=0.2, half_precision=half_precision)
otx_eval_openvino_testing(template, tmp_dir_path, otx_dir, args, threshold=0.6, half_precision=half_precision)

@e2e_pytest_component
@pytest.mark.skipif(TT_STABILITY_TESTS, reason="This is TT_STABILITY_TESTS")
Expand Down
Loading