MCPcopy Index your code
hub / github.com/PDFMathTranslate/PDFMathTranslate / test_predict

Method test_predict

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

Source from the content-addressed store, hash-verified

55 self.assertTrue(np.all(scaled_boxes <= max(img0_shape)))
56
57 def test_predict(self):
58 # Mock model inference output
59 mock_output = np.random.random((1, 300, 6))
60 self.model.model.run.return_value = [mock_output]
61
62 # Create a dummy image
63 image = np.ones((500, 300, 3), dtype=np.uint8)
64
65 results = self.model.predict(image)
66
67 # Validate predictions
68 self.assertEqual(len(results), 1)
69 self.assertIsInstance(results[0], YoloResult)
70 self.assertGreater(len(results[0].boxes), 0)
71 self.assertIsInstance(results[0].boxes[0], YoloBox)
72
73
74class TestYoloResult(unittest.TestCase):

Callers

nothing calls this directly

Calls 1

predictMethod · 0.45

Tested by

no test coverage detected