Forum Discussion
Tesseract install
- 1 year ago
Hello tamasv,
nilendraFabric is right. PyTesseract relies on Tesseract binary and libraries. They're not part of the Fabric environment, and there is no easy way to download them. Depending on your use case, you may have several options.Use EasyOCR
nilendraFabric suggestion was good. This library works within Fabric. Here is a sample code.
%pip install easyocr import easyocr reader = easyocr.Reader(['en']) result = reader.readtext("/lakehouse/default/Files/screenshot.png") for detection in result: print(detection[1])In my (small) experience, tesseract provides better results than easyOCR, so please check your use cases.
Use Azure ServicesAzure Vision AI Services provides several ML models to extract both printed and handwritter text. With Document intelligence, you can even extract structured information - for example parsing an image of an invoice and automatically get each line item.
Tesseract - manually build and reference
If you really want to use Tesseract, Technically, you could hand-install tesseract packages, this will involve manually downloading (deb) packages and untar them, but that would be quite time-consuming with all the chain of dependency. You could also compile it yourself to have a single exe with all the dependencies linked (someone on the Internet may have done that alreay).
Hope this helps!
Hello tamasv,
nilendraFabric is right. PyTesseract relies on Tesseract binary and libraries. They're not part of the Fabric environment, and there is no easy way to download them. Depending on your use case, you may have several options.
Use EasyOCR
nilendraFabric suggestion was good. This library works within Fabric. Here is a sample code.
%pip install easyocr
import easyocr
reader = easyocr.Reader(['en'])
result = reader.readtext("/lakehouse/default/Files/screenshot.png")
for detection in result:
print(detection[1])In my (small) experience, tesseract provides better results than easyOCR, so please check your use cases.
Use Azure Services
Azure Vision AI Services provides several ML models to extract both printed and handwritter text. With Document intelligence, you can even extract structured information - for example parsing an image of an invoice and automatically get each line item.
Tesseract - manually build and reference
If you really want to use Tesseract, Technically, you could hand-install tesseract packages, this will involve manually downloading (deb) packages and untar them, but that would be quite time-consuming with all the chain of dependency. You could also compile it yourself to have a single exe with all the dependencies linked (someone on the Internet may have done that alreay).
Hope this helps!
- tamasv1 year agoNew Member
Hello!
Thanks for the info provided. EasyOCR does work. Just the project is not built around that library. As our experience shows that easyocr is a bit worse for what we need it. Manual build is not my expretise, but maybe we will look into it. Also on the long run Azure Vision could be a potential candidate.
I accept this solution as it opened up some options to do the project in Azure ecosystem.
Thanks