You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I trained a custom model named decryptzero from the deep-text-recognition-benchmark repository. When attempting to test the model using reader = easyocr.Reader(['en'], gpu = True, recog_network='decryptzero'), it gives me an IndexError.
Originally I thought this was because my character list and the English alphabet character list sizes did not match (it said something like IndexError: index 40 is out of bounds for axis 0 with size 39) so I changed my character list to be exactly the same as the alphabet and the IndexError disappeared. Now when I try to OCR a processed image (using OpenCV), it suddenly says the index is 54 when the list length is 39.
I am using the greedy decoder. When I tested the default settings for the English language on a processed image, it worked fine, but my custom model isn't. But both the English model and my custom model "work" fine (in the sense that there are no errors) on an unprocessed image.
The text was updated successfully, but these errors were encountered:
The issue you're encountering seems related to the mismatch between the character list used during the model training and the character list expected during inference. The custom model's character list might not align with the default settings used by EasyOCR, causing the IndexError.
possible suggestions:-
Verify Character List Consistency
Ensure the character list used during training matches exactly with what is being used during inference. Any discrepancy can cause indexing issues.
Check Model Configuration
Make sure that the custom model is correctly configured within EasyOCR. Ensure the model path and associated configurations are properly set up.
Debugging the Character List and Indices
Print out or log the character list and the indices to ensure they match up. Check both during training and inference to ensure they are consistent.
Update EasyOCR's Model Loading
Modify EasyOCR's model loading code to load your custom character list properly. This may involve tweaking the EasyOCR source code.
Review the Decoder Configuration
Since you mentioned using a greedy decoder, ensure it's correctly set up and compatible with your character list.
Align the Preprocessing Steps
Ensure the preprocessing steps for the image (using OpenCV) are consistent between training and inference.
I trained a custom model named
decryptzero
from the deep-text-recognition-benchmark repository. When attempting to test the model usingreader = easyocr.Reader(['en'], gpu = True, recog_network='decryptzero')
, it gives me an IndexError.Originally I thought this was because my character list and the English alphabet character list sizes did not match (it said something like
IndexError: index 40 is out of bounds for axis 0 with size 39
) so I changed my character list to be exactly the same as the alphabet and the IndexError disappeared. Now when I try to OCR a processed image (using OpenCV), it suddenly says the index is 54 when the list length is 39.I am using the greedy decoder. When I tested the default settings for the English language on a processed image, it worked fine, but my custom model isn't. But both the English model and my custom model "work" fine (in the sense that there are no errors) on an unprocessed image.
The text was updated successfully, but these errors were encountered: