mirror of
https://github.com/VikParuchuri/surya.git
synced 2026-06-12 21:02:45 +08:00
Some checks failed
Integration test / build (push) Has been cancelled
Unit tests / build (t4_gpu) (push) Has been cancelled
Unit tests / build (ubuntu-latest) (push) Has been cancelled
Unit tests / build (windows-latest) (push) Has been cancelled
Test CLI scripts / build (push) Has been cancelled
19 lines
549 B
Python
19 lines
549 B
Python
from typing import List
|
|
|
|
from PIL import Image, ImageDraw
|
|
|
|
from surya.common.surya.schema import TaskNames
|
|
from surya.recognition import OCRResult
|
|
|
|
|
|
def test_latex_ocr(recognition_predictor, test_image_latex):
|
|
width, height = test_image_latex.size
|
|
results: List[OCRResult] = recognition_predictor(
|
|
[test_image_latex], [TaskNames.block_without_boxes], bboxes=[[[0, 0, width, height]]]
|
|
)
|
|
text = results[0].text_lines[0].text
|
|
assert len(results) == 1
|
|
|
|
assert text.startswith("<math")
|
|
assert text.endswith("</math>")
|