From 9b66e4ef82ba6aa3e4da5bc2f72badc53864acb2 Mon Sep 17 00:00:00 2001 From: Cybrosys Technologies Date: Mon, 27 Jan 2025 10:02:57 +0530 Subject: [PATCH] Jan 27: [FIX] Bug Fixed 'ocr_data_retrieval' --- ocr_data_retrieval/README.rst | 3 ++- ocr_data_retrieval/models/ocr_data_template.py | 1 + ocr_data_retrieval/static/description/index.html | 6 ++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ocr_data_retrieval/README.rst b/ocr_data_retrieval/README.rst index c3bf2e411..a89906ce0 100755 --- a/ocr_data_retrieval/README.rst +++ b/ocr_data_retrieval/README.rst @@ -23,7 +23,8 @@ GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3) Credits ------- -Developer: (V16) Sruthi Renjith, Contact: odoo@cybrosys.com +Developer: (V16) Sruthi Renjith, +Contact: odoo@cybrosys.com Contacts -------- diff --git a/ocr_data_retrieval/models/ocr_data_template.py b/ocr_data_retrieval/models/ocr_data_template.py index 19fec8301..82d4c93c7 100644 --- a/ocr_data_retrieval/models/ocr_data_template.py +++ b/ocr_data_retrieval/models/ocr_data_template.py @@ -140,6 +140,7 @@ class OCRDataTemplate(models.TransientModel): text += pytesseract.image_to_string(segment) + "\n" break except Exception: + print("Could not convert") raise ValidationError(_("Data cannot be read")) # Assigning retrieved data into text field self.data = text diff --git a/ocr_data_retrieval/static/description/index.html b/ocr_data_retrieval/static/description/index.html index 0a6a1898a..d668e9b1d 100755 --- a/ocr_data_retrieval/static/description/index.html +++ b/ocr_data_retrieval/static/description/index.html @@ -143,8 +143,10 @@ 1. pdf2image (pip install pdf2image). 2. PIL (pip3 install PIL). 3. pytesseract (pip3 install pytesseract). - 4. spacy (pip3 install spacy). - 5. en_core_web_sm (python3.8 -m spacy download en_core_web_sm). + 4. sudo apt install tesseract-ocr + 5. sudo apt install libtesseract-dev + 6. spacy (pip3 install spacy(3.5.2)). + 7. en_core_web_sm (python3.8 -m spacy download en_core_web_sm).