WIP
This commit is contained in:
@@ -171,8 +171,8 @@ class TestGenerateFromMatches:
|
||||
|
||||
assert len(annotations) == 0
|
||||
|
||||
def test_applies_field_specific_expansion(self):
|
||||
"""Verify different fields get different expansion."""
|
||||
def test_applies_uniform_expansion(self):
|
||||
"""Verify all fields get the same uniform expansion."""
|
||||
gen = AnnotationGenerator(min_confidence=0.5)
|
||||
|
||||
# Same bbox, different fields
|
||||
@@ -199,10 +199,11 @@ class TestGenerateFromMatches:
|
||||
dpi=150
|
||||
)[0]
|
||||
|
||||
# Bankgiro has extra_left_ratio=0.80, invoice_number has extra_top_ratio=0.40
|
||||
# They should have different widths due to different expansion
|
||||
# Bankgiro expands more to the left
|
||||
assert ann_bankgiro.width != ann_invoice.width or ann_bankgiro.x_center != ann_invoice.x_center
|
||||
# Uniform expansion: same bbox -> same dimensions (only class_id differs)
|
||||
assert ann_bankgiro.width == ann_invoice.width
|
||||
assert ann_bankgiro.height == ann_invoice.height
|
||||
assert ann_bankgiro.x_center == ann_invoice.x_center
|
||||
assert ann_bankgiro.y_center == ann_invoice.y_center
|
||||
|
||||
def test_enforces_min_bbox_height(self):
|
||||
"""Verify minimum bbox height is enforced."""
|
||||
|
||||
Reference in New Issue
Block a user