Skip to content

Commit

Permalink
add is_anomalous attribute to labels in test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
djdameln committed May 30, 2022
1 parent 2aab8df commit 16f2138
Showing 1 changed file with 32 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ def test_create_converter(self):
name="Normal", domain=Domain.ANOMALY_CLASSIFICATION, id=ID("1")
),
LabelEntity(
name="Anomalous", domain=Domain.ANOMALY_CLASSIFICATION, id=ID("2")
name="Anomalous",
domain=Domain.ANOMALY_CLASSIFICATION,
id=ID("2"),
is_anomalous=True,
),
]
label_group = LabelGroup(
Expand All @@ -310,7 +313,12 @@ def test_create_converter(self):
# "ANOMALY_DETECTION" is specified as "converter_type"
labels = [
LabelEntity(name="Normal", domain=Domain.ANOMALY_DETECTION, id=ID("1")),
LabelEntity(name="Anomalous", domain=Domain.ANOMALY_DETECTION, id=ID("2")),
LabelEntity(
name="Anomalous",
domain=Domain.ANOMALY_DETECTION,
id=ID("2"),
is_anomalous=True,
),
]
label_group = LabelGroup(name="Anomaly detection labels group", labels=labels)
label_schema = LabelSchemaEntity(label_groups=[label_group])
Expand All @@ -325,7 +333,10 @@ def test_create_converter(self):
labels = [
LabelEntity(name="Normal", domain=Domain.ANOMALY_SEGMENTATION, id=ID("1")),
LabelEntity(
name="Anomalous", domain=Domain.ANOMALY_SEGMENTATION, id=ID("2")
name="Anomalous",
domain=Domain.ANOMALY_SEGMENTATION,
id=ID("2"),
is_anomalous=True,
),
]
label_group = LabelGroup(name="Anomaly detection labels group", labels=labels)
Expand Down Expand Up @@ -947,8 +958,18 @@ def test_anomaly_classification_to_annotation_init(
non_empty_labels = [
LabelEntity(name="Normal", domain=Domain.CLASSIFICATION, id=ID("1")),
LabelEntity(name="Normal", domain=Domain.CLASSIFICATION, id=ID("2")),
LabelEntity(name="Anomalous", domain=Domain.CLASSIFICATION, id=ID("1")),
LabelEntity(name="Anomalous", domain=Domain.CLASSIFICATION, id=ID("2")),
LabelEntity(
name="Anomalous",
domain=Domain.CLASSIFICATION,
id=ID("1"),
is_anomalous=True,
),
LabelEntity(
name="Anomalous",
domain=Domain.CLASSIFICATION,
id=ID("2"),
is_anomalous=True,
),
]
label_group = LabelGroup(
name="Classification labels group", labels=non_empty_labels
Expand Down Expand Up @@ -1030,7 +1051,12 @@ def check_annotation(actual_annotation: Annotation, expected_labels: list):

non_empty_labels = [
LabelEntity(name="Normal", domain=Domain.CLASSIFICATION, id=ID("1")),
LabelEntity(name="Anomalous", domain=Domain.CLASSIFICATION, id=ID("2")),
LabelEntity(
name="Anomalous",
domain=Domain.CLASSIFICATION,
id=ID("2"),
is_anomalous=True,
),
]
label_group = LabelGroup(
name="Anomaly classification labels group", labels=non_empty_labels
Expand Down

0 comments on commit 16f2138

Please sign in to comment.