highlight audited YOLO label relationships
This commit is contained in:
@@ -2,6 +2,7 @@ import pytest
|
||||
|
||||
from scripts.render_operator_yolo_label_qa_contact_sheets import (
|
||||
CONTACT_SHEET_NAME_TEMPLATE,
|
||||
build_relationship_highlights,
|
||||
filter_tiles_by_samples,
|
||||
)
|
||||
|
||||
@@ -34,3 +35,40 @@ def test_filter_tiles_by_samples_without_filter_preserves_tiles() -> None:
|
||||
def test_contact_sheet_name_template_is_stable_and_one_indexed() -> None:
|
||||
assert CONTACT_SHEET_NAME_TEMPLATE.format(index=1) == "contact_sheet_001.png"
|
||||
assert CONTACT_SHEET_NAME_TEMPLATE.format(index=12) == "contact_sheet_012.png"
|
||||
|
||||
|
||||
def test_relationship_highlights_bind_indices_and_preserve_highest_priority() -> None:
|
||||
summary = {
|
||||
"flagged_tiles": [
|
||||
{
|
||||
"label_path": "/data/tile.txt",
|
||||
"relationships": [
|
||||
{
|
||||
"relationship": "possible_nested",
|
||||
"first_index": 2,
|
||||
"second_index": 4,
|
||||
},
|
||||
{
|
||||
"relationship": "exact_duplicate",
|
||||
"first_index": 2,
|
||||
"second_index": 5,
|
||||
},
|
||||
{
|
||||
"relationship": "near_duplicate",
|
||||
"first_index": 6,
|
||||
"second_index": 7,
|
||||
},
|
||||
],
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
assert build_relationship_highlights(summary) == {
|
||||
"/data/tile.txt": {
|
||||
2: "exact_duplicate",
|
||||
4: "possible_nested",
|
||||
5: "exact_duplicate",
|
||||
6: "near_duplicate",
|
||||
7: "near_duplicate",
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user