Margin detection update

This commit is contained in:
sebastien committed 2026-10-30 12:34:37 +01:00
1 parent 2c9dc65640
commit b295f871a7
6 files changed
+292 -68

No files matched your search

+5
View File
@@ -39,6 +39,11 @@ class MarginBenchmarkTests(unittest.TestCase):
case['sha256'])
self.assertEqual([p['page'] for p in case['pages']], list(range(1, case['page_count'] + 1)))
self.assertTrue(case['explanation'])
name_box = case['name_localization']['box_px']
self.assertEqual(case['name_localization']['page_height_px'],
case['recorded_schema']['page_crops'][0]['height_px'])
self.assertAlmostEqual(case['name_bottom_height_fraction'],
name_box[3] / case['name_localization']['page_height_px'])
self.assertTrue(any(p['labels'] for p in case['pages']))
for expected, recorded in zip(case['pages'], case['recorded_schema']['page_crops'], strict=True):
start = round(expected['suggested_start_mm'] * 200 / 25.4)