MCPcopy Create free account
hub / github.com/PDFMathTranslate/PDFMathTranslate / test_yolo_result

Method test_yolo_result

test/test_doclayout.py:75–88  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

73
74class TestYoloResult(unittest.TestCase):
75 def test_yolo_result(self):
76 # Example prediction data
77 boxes = [
78 [100, 200, 300, 400, 0.9, 0],
79 [50, 100, 150, 200, 0.8, 1],
80 ]
81 names = ["class1", "class2"]
82
83 result = YoloResult(boxes, names)
84
85 # Validate the number of boxes and their order by confidence
86 self.assertEqual(len(result.boxes), 2)
87 self.assertGreater(result.boxes[0].conf, result.boxes[1].conf)
88 self.assertEqual(result.names, names)
89
90
91class TestYoloBox(unittest.TestCase):

Callers

nothing calls this directly

Calls 1

YoloResultClass · 0.90

Tested by

no test coverage detected