Skip to content

Commit

Permalink
Fix e2e issues (#3313)
Browse files Browse the repository at this point in the history
  • Loading branch information
yunchu authored Apr 15, 2024
1 parent 61095d6 commit 5fe4088
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 33 deletions.
28 changes: 14 additions & 14 deletions tests/e2e/cli/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,38 +327,38 @@ def test_otx_explain_e2e_cli(
reference_sal_vals = {
# Classification
"multi_label_cls_efficientnet_v2_light": (
np.array([66, 97, 84, 33, 42, 79, 0], dtype=np.uint8),
"Slide6_class_0_saliency_map.png",
np.array([201, 209, 196, 158, 157, 119, 77], dtype=np.uint8),
"American_Crow_0031_25433_class_0_saliency_map.png",
),
"h_label_cls_efficientnet_v2_light": (
np.array([152, 193, 144, 132, 149, 204, 217], dtype=np.uint8),
"092_class_5_saliency_map.png",
np.array([102, 141, 134, 79, 66, 92, 84], dtype=np.uint8),
"108_class_4_saliency_map.png",
),
# Detection
"detection_yolox_tiny": (
np.array([111, 163, 141, 141, 146, 147, 158, 169, 184, 193], dtype=np.uint8),
"Slide3_class_0_saliency_map.png",
np.array([182, 194, 187, 179, 188, 206, 215, 207, 177, 130], dtype=np.uint8),
"img_371_jpg_rf_a893e0bdc6fda0ba1b2a7f07d56cec23_class_0_saliency_map.png",
),
"detection_ssd_mobilenetv2": (
np.array([135, 80, 74, 34, 27, 32, 47, 42, 32, 34], dtype=np.uint8),
"Slide3_class_0_saliency_map.png",
np.array([118, 188, 241, 213, 160, 120, 86, 94, 111, 138], dtype=np.uint8),
"img_371_jpg_rf_a893e0bdc6fda0ba1b2a7f07d56cec23_class_0_saliency_map.png",
),
"detection_atss_mobilenetv2": (
np.array([22, 62, 64, 0, 27, 60, 59, 53, 37, 45], dtype=np.uint8),
"Slide3_class_0_saliency_map.png",
np.array([29, 39, 55, 69, 80, 88, 92, 86, 100, 88], dtype=np.uint8),
"img_371_jpg_rf_a893e0bdc6fda0ba1b2a7f07d56cec23_class_0_saliency_map.png",
),
# Instance Segmentation
"instance_segmentation_maskrcnn_efficientnetb2b": (
np.array([54, 54, 54, 54, 0, 0, 0, 54, 0, 0], dtype=np.uint8),
"Slide3_class_0_saliency_map.png",
np.array([5, 5, 5, 5, 5, 5, 5, 5, 5, 5], dtype=np.uint8),
"CDY_2018_class_0_saliency_map.png",
),
}
test_case_name = task + "_" + model_name
if test_case_name in reference_sal_vals:
actual_sal_vals = cv2.imread(str(latest_dir / "saliency_maps" / reference_sal_vals[test_case_name][1]))
if test_case_name == "instance_segmentation_maskrcnn_efficientnetb2b":
# Take corner values due to map sparsity of InstSeg
actual_sal_vals = (actual_sal_vals[-10:, -1, -1]).astype(np.uint16)
# Take lower corner values due to map sparsity of InstSeg
actual_sal_vals = (actual_sal_vals[-10:, -1, 0]).astype(np.uint16)
else:
actual_sal_vals = (actual_sal_vals[:10, 0, 0]).astype(np.uint16)
ref_sal_vals = reference_sal_vals[test_case_name][0]
Expand Down
35 changes: 16 additions & 19 deletions tests/e2e/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

@pytest.fixture(scope="session")
def fxt_ci_data_root() -> Path:
data_root = Path(os.environ.get("CI_DATA_ROOT", "/home/validation/data/v2"))
data_root = Path(os.environ.get("CI_DATA_ROOT", "/home/validation/data"))
if not Path.is_dir(data_root):
msg = f"cannot find {data_root}"
raise FileNotFoundError(msg)
Expand Down Expand Up @@ -87,22 +87,22 @@ def pytest_configure(config):
@pytest.fixture()
def fxt_target_dataset_per_task(fxt_ci_data_root) -> dict:
return {
"multi_class_cls": Path(fxt_ci_data_root / "multiclass_classification/multiclass_CUB_small/1"),
"multi_label_cls": Path(fxt_ci_data_root / "multilabel_classification/multilabel_CUB_small/1"),
"h_label_cls": Path(fxt_ci_data_root / "hlabel_classification/hlabel_CUB_small/1"),
"detection": Path(fxt_ci_data_root / "detection/pothole_small/1"),
"rotated_detection": Path(fxt_ci_data_root / "detection/pothole_small/1"),
"instance_segmentation": Path(fxt_ci_data_root / "instance_seg/wgisd_small/1"),
"semantic_segmentation": Path(fxt_ci_data_root / "semantic_seg/kvasir_small/1"),
"action_classification": Path(fxt_ci_data_root / "action/action_classification/ucf_kinetics_5percent_small"),
"action_detection": Path(fxt_ci_data_root / "action/action_detection/UCF101_ava_5percent"),
"visual_prompting": Path(fxt_ci_data_root / "visual_prompting/wgisd_small/1"),
"multi_class_cls": Path(fxt_ci_data_root / "v2/multiclass_classification/multiclass_CUB_small/1"),
"multi_label_cls": Path(fxt_ci_data_root / "v2/multilabel_classification/multilabel_CUB_small/1"),
"h_label_cls": Path(fxt_ci_data_root / "v2/hlabel_classification/hlabel_CUB_small/1"),
"detection": Path(fxt_ci_data_root / "v2/detection/pothole_small/1"),
"rotated_detection": Path(fxt_ci_data_root / "v2/detection/pothole_small/1"),
"instance_segmentation": Path(fxt_ci_data_root / "v2/instance_seg/wgisd_small/1"),
"semantic_segmentation": Path(fxt_ci_data_root / "v2/semantic_seg/kvasir_small/1"),
"action_classification": Path(fxt_ci_data_root / "v2/action/action_classification/ucf_kinetics_5percent_small"),
"action_detection": Path(fxt_ci_data_root / "v2/action/action_detection/UCF101_ava_5percent"),
"visual_prompting": Path(fxt_ci_data_root / "v2/visual_prompting/wgisd_small/1"),
"zero_shot_visual_prompting": Path(
fxt_ci_data_root / "zero_shot_visual_prompting/coco_car_person_medium_datumaro",
fxt_ci_data_root / "v2/zero_shot_visual_prompting/coco_car_person_medium",
),
"anomaly_classification": Path(fxt_ci_data_root / "anomaly/mvtec/bottle_small/1"),
"anomaly_detection": Path(fxt_ci_data_root / "anomaly/mvtec/hazelnut_large"),
"anomaly_segmentation": Path(fxt_ci_data_root / "anomaly/mvtec/hazelnut_large"),
"anomaly_classification": Path(fxt_ci_data_root / "v2/anomaly/mvtec/bottle_small/1"),
"anomaly_detection": Path(fxt_ci_data_root / "v2/anomaly/mvtec/hazelnut_large"),
"anomaly_segmentation": Path(fxt_ci_data_root / "v2/anomaly/mvtec/hazelnut_large"),
}


Expand All @@ -122,10 +122,7 @@ def fxt_cli_override_command_per_task() -> dict:
"3",
],
"visual_prompting": [],
"zero_shot_visual_prompting": [
"--data.config.data_format",
"datumaro",
],
"zero_shot_visual_prompting": [],
"anomaly_classification": [],
"anomaly_detection": [],
"anomaly_segmentation": [],
Expand Down

0 comments on commit 5fe4088

Please sign in to comment.