Spaces:
Build error
Build error
debu das
commited on
Commit
·
a21ebb3
1
Parent(s):
5df50a7
Update app.py
Browse files
app.py
CHANGED
@@ -43,19 +43,19 @@ async def pytess(cell_pil_img):
|
|
43 |
print("pytess_output######################################")
|
44 |
print(pytess_output)
|
45 |
print("pytess_output@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")
|
46 |
-
|
47 |
###paddleocr
|
48 |
paddle_output=' '
|
49 |
cell_cv_img=PIL_to_cv(cell_pil_img)
|
50 |
-
ocr = PaddleOCR(lang="ch") # need to run only once to download and load model into memory
|
51 |
-
result = ocr.ocr(cell_cv_img, det=False, cls=
|
52 |
for idx in range(len(result)):
|
53 |
res = result[idx]
|
54 |
for line in res:
|
55 |
-
print(line)
|
56 |
-
paddle_output=paddle_output.join(' ').join(line)
|
57 |
print(paddle_output)
|
58 |
-
print("paddleocr
|
59 |
return pytess_output
|
60 |
|
61 |
# def super_res(pil_img):
|
|
|
43 |
print("pytess_output######################################")
|
44 |
print(pytess_output)
|
45 |
print("pytess_output@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@")
|
46 |
+
|
47 |
###paddleocr
|
48 |
paddle_output=' '
|
49 |
cell_cv_img=PIL_to_cv(cell_pil_img)
|
50 |
+
ocr = PaddleOCR(use_angle_cls=True,lang="ch") # need to run only once to download and load model into memory
|
51 |
+
result = ocr.ocr(cell_cv_img, det=False, cls=True)
|
52 |
for idx in range(len(result)):
|
53 |
res = result[idx]
|
54 |
for line in res:
|
55 |
+
#print(line)
|
56 |
+
paddle_output=paddle_output.join(' ').join(line[0])
|
57 |
print(paddle_output)
|
58 |
+
print("paddleocr$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$")
|
59 |
return pytess_output
|
60 |
|
61 |
# def super_res(pil_img):
|