Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,13 +8,6 @@ import gradio as gr
|
|
8 |
def tesseract_ocr(filepath: str, languages: List[str]):
|
9 |
image = Image.open(filepath)
|
10 |
return pytesseract.image_to_string(image=image, lang=', '.join(languages))
|
11 |
-
|
12 |
-
def highlight_keyword(text: str, keyword: str) -> str:
|
13 |
-
"""Highlight the keyword in the text."""
|
14 |
-
if keyword:
|
15 |
-
highlighted = f"<mark>{keyword}</mark>"
|
16 |
-
return text.replace(keyword, highlighted)
|
17 |
-
return text
|
18 |
|
19 |
title = "Tesseract OCR"
|
20 |
description = "Gradio demo for Tesseract. Tesseract is an open source text recognition (OCR) Engine."
|
|
|
8 |
def tesseract_ocr(filepath: str, languages: List[str]):
|
9 |
image = Image.open(filepath)
|
10 |
return pytesseract.image_to_string(image=image, lang=', '.join(languages))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
title = "Tesseract OCR"
|
13 |
description = "Gradio demo for Tesseract. Tesseract is an open source text recognition (OCR) Engine."
|