Spaces:
Build error
Build error
Vaibhav Gaikwad commited on
Commit ·
021b753
1
Parent(s): cf220c1
testing easyOCR preprocessing internally
Browse files
app.py
CHANGED
|
@@ -156,11 +156,18 @@ def ocr_fn(image):
|
|
| 156 |
# convert pil to cv2 for preprocessing
|
| 157 |
cv2_image = pil_to_cv2(image)
|
| 158 |
|
| 159 |
-
# preprocessing runs on cpu — outside the gpu function
|
| 160 |
-
clean = preprocess(cv2_image)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 161 |
|
| 162 |
# ocr inference on cpu
|
| 163 |
-
text = ocr_gpu(
|
|
|
|
| 164 |
return text
|
| 165 |
|
| 166 |
except Exception as e:
|
|
|
|
| 156 |
# convert pil to cv2 for preprocessing
|
| 157 |
cv2_image = pil_to_cv2(image)
|
| 158 |
|
| 159 |
+
# # preprocessing runs on cpu — outside the gpu function
|
| 160 |
+
# clean = preprocess(cv2_image)
|
| 161 |
+
|
| 162 |
+
# # ocr inference on cpu
|
| 163 |
+
# text = ocr_gpu(clean)
|
| 164 |
+
|
| 165 |
+
# trusting easyOCR for test preprocess
|
| 166 |
+
# clean = preprocess(cv2_image)
|
| 167 |
|
| 168 |
# ocr inference on cpu
|
| 169 |
+
text = ocr_gpu(cv2_image)
|
| 170 |
+
|
| 171 |
return text
|
| 172 |
|
| 173 |
except Exception as e:
|