Browse Source

Jan 27: [FIX] Bug Fixed 'ocr_data_retrieval'

pull/302/merge
Cybrosys Technologies 3 months ago
parent
commit
9b66e4ef82
  1. 3
      ocr_data_retrieval/README.rst
  2. 1
      ocr_data_retrieval/models/ocr_data_template.py
  3. 6
      ocr_data_retrieval/static/description/index.html

3
ocr_data_retrieval/README.rst

@ -23,7 +23,8 @@ GNU AFFERO GENERAL PUBLIC LICENSE, Version 3 (AGPLv3)
Credits Credits
------- -------
Developer: (V16) Sruthi Renjith, Contact: odoo@cybrosys.com Developer: (V16) Sruthi Renjith,
Contact: odoo@cybrosys.com
Contacts Contacts
-------- --------

1
ocr_data_retrieval/models/ocr_data_template.py

@ -140,6 +140,7 @@ class OCRDataTemplate(models.TransientModel):
text += pytesseract.image_to_string(segment) + "\n" text += pytesseract.image_to_string(segment) + "\n"
break break
except Exception: except Exception:
print("Could not convert")
raise ValidationError(_("Data cannot be read")) raise ValidationError(_("Data cannot be read"))
# Assigning retrieved data into text field # Assigning retrieved data into text field
self.data = text self.data = text

6
ocr_data_retrieval/static/description/index.html

@ -143,8 +143,10 @@
1. pdf2image (pip install pdf2image). 1. pdf2image (pip install pdf2image).
2. PIL (pip3 install PIL). 2. PIL (pip3 install PIL).
3. pytesseract (pip3 install pytesseract). 3. pytesseract (pip3 install pytesseract).
4. spacy (pip3 install spacy). 4. sudo apt install tesseract-ocr
5. en_core_web_sm (python3.8 -m spacy download en_core_web_sm). 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).
</div> </div>
</div> </div>
<!-- END OF CONFIGURATION SECTION --> <!-- END OF CONFIGURATION SECTION -->

Loading…
Cancel
Save