Upload folder using huggingface_hub
Browse files
app.py
CHANGED
@@ -271,7 +271,7 @@ def process_image(image):
|
|
271 |
# Initialize list to hold recognized text from each detected area
|
272 |
recognized_texts = {}
|
273 |
pil_image = Image.open(image_path)
|
274 |
-
|
275 |
# Process each detected bounding box for script identification and text recognition
|
276 |
for id,bbox in enumerate(detections):
|
277 |
# Identify the script and crop the image to this region
|
@@ -290,7 +290,7 @@ def process_image(image):
|
|
290 |
|
291 |
|
292 |
# Combine recognized texts into a single string for display
|
293 |
-
return output_image, translated
|
294 |
|
295 |
# Custom HTML for interface header with logos and alignment
|
296 |
interface_html = """
|
|
|
271 |
# Initialize list to hold recognized text from each detected area
|
272 |
recognized_texts = {}
|
273 |
pil_image = Image.open(image_path)
|
274 |
+
script_lang = "english"
|
275 |
# Process each detected bounding box for script identification and text recognition
|
276 |
for id,bbox in enumerate(detections):
|
277 |
# Identify the script and crop the image to this region
|
|
|
290 |
|
291 |
|
292 |
# Combine recognized texts into a single string for display
|
293 |
+
return output_image, script_lang + " " +translated
|
294 |
|
295 |
# Custom HTML for interface header with logos and alignment
|
296 |
interface_html = """
|