Spaces:
Sleeping
Sleeping
Update modules/kyc_processor.py
Browse files- modules/kyc_processor.py +2 -3
modules/kyc_processor.py
CHANGED
|
@@ -3,7 +3,6 @@ import cv2
|
|
| 3 |
|
| 4 |
def extract_text_from_id(image_path):
|
| 5 |
image = cv2.imread(image_path)
|
|
|
|
|
|
|
| 6 |
return pytesseract.image_to_string(image)
|
| 7 |
-
|
| 8 |
-
def verify_id(document_text):
|
| 9 |
-
return "Name" in document_text and "DOB" in document_text # simple example
|
|
|
|
| 3 |
|
| 4 |
def extract_text_from_id(image_path):
|
| 5 |
image = cv2.imread(image_path)
|
| 6 |
+
if image is None:
|
| 7 |
+
raise ValueError(f"Invalid image file: {image_path}")
|
| 8 |
return pytesseract.image_to_string(image)
|
|
|
|
|
|
|
|
|