Skip to content

Commit 7e23c3d

Browse files
committed
correct the typo
1 parent 0cf7c44 commit 7e23c3d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scrapegraphai/screenshot_scraping/text_detection.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from surya.model.recognition.processor import load_processor as load_rec_processor
66

77

8-
def detect_text(image, lahguages: list = ["en"]):
8+
def detect_text(image, languages: list = ["en"]):
99
"""
1010
Detects and extracts text from a given image.
1111
Parameters:
@@ -17,11 +17,12 @@ def detect_text(image, lahguages: list = ["en"]):
1717
Model weights will automatically download the first time you run this function.
1818
"""
1919

20-
langs = lahguages
20+
langs = languages
2121
det_processor, det_model = load_det_processor(), load_det_model()
2222
rec_model, rec_processor = load_rec_model(), load_rec_processor()
2323
predictions = run_ocr([image], [langs], det_model,
2424
det_processor, rec_model, rec_processor)
25+
2526
text = "\n".join([line.text for line in predictions[0].text_lines])
2627
return text
2728

0 commit comments

Comments
 (0)