Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,7 @@ import gradio as gr
|
|
6 |
import torch
|
7 |
import easyocr
|
8 |
import omegaconf
|
9 |
-
|
10 |
|
11 |
from vietocr.vietocr.tool.predictor import Predictor
|
12 |
from vietocr.vietocr.tool.config import Cfg
|
@@ -48,7 +48,7 @@ def inference(filepath, lang):
|
|
48 |
# crop the region of interest (ROI)
|
49 |
|
50 |
cropped_image = img.crop((min_x, min_y, max_x, max_y)) # crop the image
|
51 |
-
cropped_image =
|
52 |
out = recognitor.predict(cropped_image)
|
53 |
print(out)
|
54 |
new_bounds.append((bbox,text, out, prob))
|
|
|
6 |
import torch
|
7 |
import easyocr
|
8 |
import omegaconf
|
9 |
+
import numpy
|
10 |
|
11 |
from vietocr.vietocr.tool.predictor import Predictor
|
12 |
from vietocr.vietocr.tool.config import Cfg
|
|
|
48 |
# crop the region of interest (ROI)
|
49 |
|
50 |
cropped_image = img.crop((min_x, min_y, max_x, max_y)) # crop the image
|
51 |
+
cropped_image = numpy.array(cropped_image)
|
52 |
out = recognitor.predict(cropped_image)
|
53 |
print(out)
|
54 |
new_bounds.append((bbox,text, out, prob))
|