Breta01 / handwriting-ocr

OCR software for recognition of handwritten text
MIT License
753 stars 239 forks source link

Recommended training specs #49

Open puppetmaster12 opened 6 years ago

puppetmaster12 commented 6 years ago

What is the recommended training specifications? How long would it take on a CPU with 16GB of RAM, 3.5ghz?

Breta01 commented 6 years ago

Hi,

It depends on what you want to train. The models right now are trained on my handwriting (which is small database) with relatively small models. If you want to create some production model you will have to use some larger database like IAM. You will also need to increase parameters in neural nets, so they will also take more processing power. In general you can train almost on any computer, but stronger computers are better. Your RAM should be fine. And I don't know number of your CPU cores. Also look if your GPU is supported by TensorFlow, that can also speed up training.

Dne čt 26. 7. 2018 10:39 uživatel puppetmaster12 notifications@github.com napsal:

What is the recommended training specifications? How long would it take on a CPU with 16GB of RAM, 3.5ghz?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Breta01/handwriting-ocr/issues/49, or mute the thread https://github.com/notifications/unsubscribe-auth/AJz-4DUfpShLdNFlMX76oDTJ3PteGbSZks5uKYBbgaJpZM4VhZ_1 .

puppetmaster12 commented 6 years ago

I tried using the IAM dataset preprocessing script in your repo. I got a recursion depth exceeded error at about 30%. Is it safe to increase the recursion limit or should i rewrite the algorithm in some way?

Breta01 commented 6 years ago

Actually I am not sure if the new way of normalization brings any benefits, so you can change the param to hystNorm=False or you can try increasing recursion limit. Even simpler approach is to set the function to:

def hystImageNorm(image):
    img = cv2.cvtColor(image, cv2.COLOR_RGB2GRAY)
    img = cv2.bilateralFilter(img, 10, 15, 30)
    img = 255 - cv2.normalize(img, None, 0, 255, cv2.NORM_MINMAX)
    # img = cv2.threshold(img, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)[1]
    return img