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
|
Extracted text from the image
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
# Load the OCR model with reliable architecture
|
# Load the OCR model with state-of-the-art PARSeq recognition
|
||||||
model = ocr_predictor(det_arch='db_resnet50', reco_arch='crnn_vgg16_bn', pretrained=True)
|
model = ocr_predictor(det_arch='db_resnet50', reco_arch='parseq', pretrained=True)
|
||||||
|
|
||||||
# Load the document from the image file
|
# Load the document from the image file
|
||||||
doc = DocumentFile.from_images(image_path)
|
doc = DocumentFile.from_images(image_path)
|
||||||
|
|||||||
Reference in New Issue
Block a user