Spaces:
Build error
Build error
debu das
commited on
Commit
•
7fa0911
1
Parent(s):
9fa69a2
Update app.py
Browse files
app.py
CHANGED
@@ -47,18 +47,20 @@ async def pytess(cell_pil_img):
|
|
47 |
###paddleocr
|
48 |
paddle_output=' '
|
49 |
cell_cv_img=PIL_to_cv(cell_pil_img)
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
for
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
|
|
|
|
62 |
print("paddleocr@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")
|
63 |
print(paddle_output)
|
64 |
print("paddleocr$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$")
|
|
|
47 |
###paddleocr
|
48 |
paddle_output=' '
|
49 |
cell_cv_img=PIL_to_cv(cell_pil_img)
|
50 |
+
height, width, channels = cell_cv_img.shape
|
51 |
+
if height>=2000 and width>=2000:
|
52 |
+
ocr = PaddleOCR(use_angle_cls=True,use_space_char=True) # need to run only once to download and load model into memory
|
53 |
+
result = ocr.ocr(cell_cv_img,cls=True)
|
54 |
+
print(result)
|
55 |
+
print("___________________________________________________________")
|
56 |
+
for idx in range(len(result)):
|
57 |
+
res = result[idx]
|
58 |
+
for line in res:
|
59 |
+
print(line)
|
60 |
+
print(line[1][0])
|
61 |
+
print("____________________________@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")
|
62 |
+
paddle_output=paddle_output+' '+line[1][0]
|
63 |
+
paddle_output=paddle_output+' '
|
64 |
print("paddleocr@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")
|
65 |
print(paddle_output)
|
66 |
print("paddleocr$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$")
|