Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -40,7 +40,7 @@ def get_width(image, height=DEFAULT_HEIGHT):
|
|
40 |
return height * aspect_ratio
|
41 |
|
42 |
def predict(model_name, input_img):
|
43 |
-
model_dir = 'pylaia-
|
44 |
temperature = 2.0
|
45 |
batch_size = 1
|
46 |
|
@@ -118,7 +118,7 @@ def process_image(image):
|
|
118 |
crop_pil = Image.fromarray(cv2.cvtColor(crop_img, cv2.COLOR_BGR2RGB))
|
119 |
|
120 |
# Recognize text using PyLaia model
|
121 |
-
predicted = predict('
|
122 |
texts.append(predicted[1]["text"])
|
123 |
|
124 |
bboxes.append((x1, y1, x2, y2))
|
|
|
40 |
return height * aspect_ratio
|
41 |
|
42 |
def predict(model_name, input_img):
|
43 |
+
model_dir = 'pylaia-samaritan_v1'
|
44 |
temperature = 2.0
|
45 |
batch_size = 1
|
46 |
|
|
|
118 |
crop_pil = Image.fromarray(cv2.cvtColor(crop_img, cv2.COLOR_BGR2RGB))
|
119 |
|
120 |
# Recognize text using PyLaia model
|
121 |
+
predicted = predict('pylaia-samaritan_v1', crop_pil)
|
122 |
texts.append(predicted[1]["text"])
|
123 |
|
124 |
bboxes.append((x1, y1, x2, y2))
|