Upload handler.py
Browse files- handler.py +6 -1
handler.py
CHANGED
@@ -8,7 +8,12 @@ from paddleocr import PaddleOCR, draw_ocr
|
|
8 |
class EndpointHandler():
|
9 |
def __init__(self, path=""):
|
10 |
|
11 |
-
self.pipeline = PaddleOCR(lang="en",ocr_version="PP-OCRv4",
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
|
14 |
def __call__(self, data: Any) -> List[List[Dict[str, float]]]:
|
|
|
8 |
class EndpointHandler():
|
9 |
def __init__(self, path=""):
|
10 |
|
11 |
+
self.pipeline = PaddleOCR(lang="en",ocr_version="PP-OCRv4",
|
12 |
+
show_log = False,use_gpu=True,
|
13 |
+
det_model_dir=path,
|
14 |
+
cls_model_dir=path,
|
15 |
+
rec_model_dir=path
|
16 |
+
)
|
17 |
|
18 |
|
19 |
def __call__(self, data: Any) -> List[List[Dict[str, float]]]:
|