Skip to content

I can't train the model to recognize a single character #1430

@ViktorZam

Description

@ViktorZam

Hello, no model can recognize the number 4 in this image: https://drive.google.com/file/d/1xlKTDl0aBUootWFWxIYFJbE1xYjVOfS_/view?usp=sharing
I trained the cyrillic_g2.pth model with the following data: https://drive.google.com/drive/folders/1P1sM0HqML-UlDsmCtO6DQC4dkreqYoO6 ?usp=sharing
I also tried to train the model with such data: https://drive.google.com/drive/folders/1_7O_FEpIcbDdd9gIR4pSZuQ34tVZabCt?usp=sharing

log_dataset.txt
log_train.txt
opt.txt

but the number 4 is also not recognizable...
to use a custom model:

reader = easyocr.Reader(["ru"], False, 
                        model_storage_directory="EasyOCR/model",
                        user_network_directory="EasyOCR/user_network",
                        recog_network='custom_model')
img = cv.resize(img, None, fx=IncSizeImg, fy=IncSizeImg, interpolation=cv.INTER_LANCZOS4)#cv.INTER_LANCZOS4
    if filters:
        gray_img = cv.cvtColor(img, cv.COLOR_BGR2GRAY)
        sharpen_kernel = np.array([[0,-1,0], [-1,5,-1], [0,-1,0]])
        gray_img = cv.filter2D(gray_img, -1, sharpen_kernel)
    
    #binary_img = cv.adaptiveThreshold(gray_img, 255, cv.ADAPTIVE_THRESH_MEAN_C, cv.THRESH_BINARY, 12, 4)
        binary_img = cv.threshold(gray_img,thresh,255,cv.THRESH_BINARY_INV)[1]
        img = binary_img
 

    cv.imwrite("Debug/" + str(time.time()) + ".png", img)
    
    result = reader.readtext(img, detail=0, allowlist=allowchars, paragraph=check_paragraph)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions