a
This commit is contained in:
@@ -56,8 +56,8 @@ def perform_ocr(image_path: str, lang: str = 'eng') -> str:
|
||||
Extracted text from the image
|
||||
"""
|
||||
try:
|
||||
# Load the OCR model with reliable architecture
|
||||
model = ocr_predictor(det_arch='db_resnet50', reco_arch='crnn_vgg16_bn', pretrained=True)
|
||||
# Load the OCR model with state-of-the-art PARSeq recognition
|
||||
model = ocr_predictor(det_arch='db_resnet50', reco_arch='parseq', pretrained=True)
|
||||
|
||||
# Load the document from the image file
|
||||
doc = DocumentFile.from_images(image_path)
|
||||
|
||||
Reference in New Issue
Block a user