Spaces:
Sleeping
Sleeping
Update ocr_engine.py
Browse files- ocr_engine.py +0 -2
ocr_engine.py
CHANGED
@@ -8,7 +8,6 @@ from PIL import Image
|
|
8 |
# Setup logging
|
9 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
10 |
|
11 |
-
|
12 |
def preprocess_strong(img):
|
13 |
"""Sharpen and enhance contrast for blurry weight images."""
|
14 |
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
|
@@ -29,7 +28,6 @@ def preprocess_strong(img):
|
|
29 |
|
30 |
return sharpened
|
31 |
|
32 |
-
|
33 |
def extract_weight_from_image(pil_img):
|
34 |
"""Extract weight from an image using multiple Tesseract strategies."""
|
35 |
try:
|
|
|
8 |
# Setup logging
|
9 |
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
10 |
|
|
|
11 |
def preprocess_strong(img):
|
12 |
"""Sharpen and enhance contrast for blurry weight images."""
|
13 |
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
|
|
|
28 |
|
29 |
return sharpened
|
30 |
|
|
|
31 |
def extract_weight_from_image(pil_img):
|
32 |
"""Extract weight from an image using multiple Tesseract strategies."""
|
33 |
try:
|