Spaces:
Sleeping
Sleeping
ITSAIDI
commited on
Commit
•
d7c9d31
1
Parent(s):
544c870
skkl
Browse files- utilitis.py +2 -5
utilitis.py
CHANGED
@@ -19,9 +19,8 @@ def Labels():
|
|
19 |
|
20 |
#############################################################################
|
21 |
#############################################################################
|
22 |
-
|
23 |
-
|
24 |
-
return ocr
|
25 |
|
26 |
def processbbox(BBOX, width, height):
|
27 |
bbox = []
|
@@ -41,7 +40,6 @@ def processbbox(BBOX, width, height):
|
|
41 |
|
42 |
def Preprocess(image):
|
43 |
image_array = np.array(image)
|
44 |
-
ocr = Paddle()
|
45 |
width, height = image.size
|
46 |
results = ocr.ocr(image_array, cls=True)
|
47 |
results = results[0]
|
@@ -76,7 +74,6 @@ def unnormalize_box(bbox, width, height):
|
|
76 |
height * (bbox[3] / 1000),
|
77 |
]
|
78 |
def get_word(bboxes,image):
|
79 |
-
ocr = Paddle()
|
80 |
x_min, y_min, x_max, y_max = bboxes
|
81 |
roi = image.crop((x_min, y_min, x_max, y_max)) # Region of intrest
|
82 |
roi_np = np.array(roi) # To array
|
|
|
19 |
|
20 |
#############################################################################
|
21 |
#############################################################################
|
22 |
+
ocr = PaddleOCR(use_angle_cls=False,lang='fr',rec=False)
|
23 |
+
|
|
|
24 |
|
25 |
def processbbox(BBOX, width, height):
|
26 |
bbox = []
|
|
|
40 |
|
41 |
def Preprocess(image):
|
42 |
image_array = np.array(image)
|
|
|
43 |
width, height = image.size
|
44 |
results = ocr.ocr(image_array, cls=True)
|
45 |
results = results[0]
|
|
|
74 |
height * (bbox[3] / 1000),
|
75 |
]
|
76 |
def get_word(bboxes,image):
|
|
|
77 |
x_min, y_min, x_max, y_max = bboxes
|
78 |
roi = image.crop((x_min, y_min, x_max, y_max)) # Region of intrest
|
79 |
roi_np = np.array(roi) # To array
|