CoolFace
Apppublic

epochTechnology/ocr.api-1

sourceHugging Faceupdated 10mo agoView on Hugging Face
0likes
detect.py10 linesDownload Raw Back to root
1import easyocr2import os3 4current_directory = os.getcwd()5def detect_OCR(image, is_paragraph=False, x_thresh=1.2, y_thresh=0.5):6    reader = easyocr.Reader(['tr'], gpu=True, model_storage_directory=f"{current_directory}/model", user_network_directory=f"{current_directory}/user_network", download_enabled=False)7    result = reader.readtext(image, min_size=50, detail=0, paragraph=is_paragraph, width_ths=x_thresh, height_ths=y_thresh, blocklist="|[]{}")8    return result9 10