EasyOCR works well and is quick on localhost but is extremely slow and never finishes once deployed on digital ocean(Ubuntu 22.10). I have two versions.
1: One where i download the model storage_directory
2: Without downloading but directing to path where "craft_mlt_25k.pth" and "english_g2.pth" exist. Downloaded from -> https://www.jaided.ai/easyocr/modelhub/
import easyocr
reader = easyocr.Reader(['en', 'sv'], gpu=False, download_enabled=True, model_storage_directory=None)
results = reader.readtext(img)
easyocr_Confidence = 0.4
easyocrString = ""
for detection in results:
if detection[2] > easyocr_Confidence:
easyocrString += detection[1] + ' '
print(easyocrString)
import easyocr
path = "/var/www/*****/*****/*****/server/utils"
reader = easyocr.Reader(['en'], gpu=False, download_enabled=False, model_storage_directory=path)
results = reader.readtext(img)
easyocr_Confidence = 0.4
easyocrString = ""
for detection in results:
if detection[2] > easyocr_Confidence:
easyocrString += detection[1] + ' '
print(easyocrString)
What am i missing here or doing incorrect? Is this possible to achieve?