Upload folder using huggingface_hub
Browse files
app.py
CHANGED
@@ -234,8 +234,9 @@ def process_image(image):
|
|
234 |
# Process each detected bounding box for script identification and text recognition
|
235 |
for id,bbox in enumerate(detections):
|
236 |
# Identify the script and crop the image to this region
|
237 |
-
script_lang, cropped_path =
|
238 |
|
|
|
239 |
if script_lang: # Only proceed if a script language is identified
|
240 |
# Recognize text in the cropped area
|
241 |
recognized_text = ocr.recognise(cropped_path, "english")
|
|
|
234 |
# Process each detected bounding box for script identification and text recognition
|
235 |
for id,bbox in enumerate(detections):
|
236 |
# Identify the script and crop the image to this region
|
237 |
+
script_lang, cropped_path = ocr.crop_and_identify_script(pil_image, bbox)
|
238 |
|
239 |
+
script_lang = "english"
|
240 |
if script_lang: # Only proceed if a script language is identified
|
241 |
# Recognize text in the cropped area
|
242 |
recognized_text = ocr.recognise(cropped_path, "english")
|