Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -4,10 +4,15 @@ import torch
|
|
4 |
|
5 |
torch.hub.load('baudm/parseq', 'parseq', pretrained=True)
|
6 |
|
7 |
-
model_path = r"parseq_tamil_v6.ckpt"
|
8 |
-
text_detect_model = r"craft_mlt_25k.pth" # add the full path of the craft model
|
9 |
-
ocr_detect = OCR(detect=True,tamil_model_path=model_path,detect_model_path=text_detect_model,enable_cuda=True)
|
10 |
-
ocr_recognize = OCR(detect=False,tamil_model_path=model_path,detect_model_path=text_detect_model,enable_cuda=True)
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
def predict(image_path,mode):
|
13 |
if mode == "recognize":
|
|
|
4 |
|
5 |
torch.hub.load('baudm/parseq', 'parseq', pretrained=True)
|
6 |
|
7 |
+
# model_path = r"parseq_tamil_v6.ckpt"
|
8 |
+
# text_detect_model = r"craft_mlt_25k.pth" # add the full path of the craft model
|
9 |
+
# ocr_detect = OCR(detect=True,tamil_model_path=model_path,detect_model_path=text_detect_model,enable_cuda=True)
|
10 |
+
# ocr_recognize = OCR(detect=False,tamil_model_path=model_path,detect_model_path=text_detect_model,enable_cuda=True)
|
11 |
+
|
12 |
+
|
13 |
+
ocr_detect = OCR(detect=True,enable_cuda=False)
|
14 |
+
ocr_recognize = OCR(detect=False,enable_cuda=False)
|
15 |
+
|
16 |
|
17 |
def predict(image_path,mode):
|
18 |
if mode == "recognize":
|