Spaces:
Build error
Build error
napatswift
commited on
Commit
•
0ad5782
1
Parent(s):
edc1665
Change to cpu
Browse files
main.py
CHANGED
@@ -3,10 +3,8 @@ import gradio as gr
|
|
3 |
import cv2
|
4 |
|
5 |
model_dir = 'model'
|
6 |
-
ocr = MMOCR(
|
7 |
-
|
8 |
-
det_ckpt=f'{model_dir}/epoch_40.pth'
|
9 |
-
)
|
10 |
|
11 |
def predict(inp):
|
12 |
return str(ocr.readtext(inp))
|
|
|
3 |
import cv2
|
4 |
|
5 |
model_dir = 'model'
|
6 |
+
ocr = MMOCR(det_config=f'{model_dir}/config.py',
|
7 |
+
det_ckpt=f'{model_dir}/epoch_40.pth', device='cpu')
|
|
|
|
|
8 |
|
9 |
def predict(inp):
|
10 |
return str(ocr.readtext(inp))
|