Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -59,7 +59,7 @@ def process_image(input_image):
|
|
59 |
|
60 |
# OPTIMIZATION: Resize the image to reduce processing time
|
61 |
# Calculate aspect ratio to maintain proportions
|
62 |
-
max_size = (
|
63 |
cropped_image.thumbnail(max_size, Image.LANCZOS)
|
64 |
|
65 |
# Select the corresponding OCR prompt based on the YOLO label
|
@@ -111,7 +111,7 @@ def process_image(input_image):
|
|
111 |
|
112 |
output = ocr_model.generate(
|
113 |
**inputs,
|
114 |
-
temperature=0.
|
115 |
max_new_tokens=1024,
|
116 |
num_return_sequences=1,
|
117 |
do_sample=True,
|
|
|
59 |
|
60 |
# OPTIMIZATION: Resize the image to reduce processing time
|
61 |
# Calculate aspect ratio to maintain proportions
|
62 |
+
max_size = (800, 800) # Further reduced from 800x800
|
63 |
cropped_image.thumbnail(max_size, Image.LANCZOS)
|
64 |
|
65 |
# Select the corresponding OCR prompt based on the YOLO label
|
|
|
111 |
|
112 |
output = ocr_model.generate(
|
113 |
**inputs,
|
114 |
+
temperature=0.8,
|
115 |
max_new_tokens=1024,
|
116 |
num_return_sequences=1,
|
117 |
do_sample=True,
|