kartikgill / easter2 Goto Github PK
View Code? Open in Web Editor NEWEaster2.0: IMPROVING CONVOLUTIONAL MODELS FOR HANDWRITTEN TEXT RECOGNITION
License: Apache License 2.0
Easter2.0: IMPROVING CONVOLUTIONAL MODELS FOR HANDWRITTEN TEXT RECOGNITION
License: Apache License 2.0
Can you also share the weights of the model without any augmentation. It would be nice if you share weights of other models with different augmentations as given in table 4 of your paper.
I am trying to reduce the image size from (2000, 80) [default] to (1000, 80) and have set LONG_LINES augmentation to False.
I am getting the following error.
tensorflow.python.framework.errors_impl.InvalidArgumentError: 2 root error(s) found.
(0) Invalid argument: sequence_length(0) <= 250
[[node functional_3/ctc/CTCLoss (defined at easter_model.py:33) ]]
(1) Invalid argument: sequence_length(0) <= 250
[[node functional_3/ctc/CTCLoss (defined at easter_model.py:33) ]]
[[functional_3/ctc/CTCLoss/_154]]
0 successful operations.
0 derived errors ignored. [Op:__inference_train_function_11028]
Do I need to change something in the model to make it work? Please help. TIA
Hi Kartik,
Thanks for this EASTER2.0 model. I have tried it with lots of data and it has given great results. I had a query regarding this, I am planning to alter this for predicting Handwritten Word cropping's. Do you reckon its a good idea? If yes what are the changes that needs to be done from the architecture side and how should the input and output shape be varied. I have good amount of word level handwritten training data (~200k) which are well preprocessed and cropped. I am hoping i can make use of this model to predict and get good results.
Thanks,
Nithin
Hello Authors! Great work.
I just found the statistics provided in the arxiv pre-print a little bit confusing. While presenting the IAM dataset stats, it looked like there are 64 lac training images. The different commas used for decimal separation and for separation of two different numbers became apparent to me only when I want to check the statistics in the IAM website. Please re-phrase the sentence :
to
IAM A has about 6,482 lines for training , 976 for validation and 2,915 for testing. IAM-B has about 6,161 for training, 940 for validation and 1,861 for testing.
On first read, I computed 10% of IAM as 6 lac and was wondering how could that be called few-shot?
I tried running predict_line.py on command prompt
python predict_line.py --path C:/Handwritten_OCR/HTRPipeline-master/HTRPipeline-master/data1/eng_AF_004.jpg
but I am getting this error
EOF read where object expected
Unable to Load Checkpoint.
Traceback (most recent call last):
File "C:\Handwritten_OCR\Easter2-main\Easter2-main\src\predict_line.py", line 72, in <module>
print(infer_obj.predict(args.path)) ## change the image path with the file path you want
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Handwritten_OCR\Easter2-main\Easter2-main\src\predict_line.py", line 57, in predict
output = self.model.predict(img)
^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'predict'
I would appreciate if anyone can help.
Hey @kartikgill
Can you please provide the link of model "saved_checkpoint.hdf5"
I am trying to run prediction on IAM dataset. Getting an error while loading saved_checkpoints from release section.The error is unable to load checkpoints.
Your work is of great application value. Vertical tiles can improve the performance. But how to select the super parameters for data argument, especially T_ Max, i think this should be related to the height of the text line. can you give me some suggestions.
def ctc_custom(args):
"""
custom CTC loss
"""
y_pred, labels, input_length, label_length = args
ctc_loss = K.ctc_batch_cost(
labels,
y_pred,
input_length,
label_length
)
p = tensorflow.exp(-ctc_loss)
gamma = 0.5
alpha=0.25
return alpha*(K.pow((1-p),gamma))*ctc_loss
how to understand the codes
Hi, can you please provide a notebook or code for testing on individual images?
could please show the demo of infering one image and give us the link of the pretrained checkpoint??
Hi,
Great work first of all. Had been looking for something like this last year. I've updated the leader board over Paperwswithcode. Please change in case you feel I made a mistake.
Also, any plans of releasing the pre-trained weights?
Hello,
I am trying to train the model with only 10 epochs. To test, I am using the last checkpoint saved in the weights
folder during the training process. When I run test_on_iam(checkpoint="../weights/EASTER2--10--6.52.hdf5")
, it says I have a SystemError
from an unknown opcode.
Upon investigation, a lot of errors trace back to the python versions used to train and test the model. However, I am sure that I trained the model with same version I am using to test it. I have also read that it could be caused by the use of the lambda layer in the model. However, there aren't any apparent issues with the lambda layer.
Additionally, when I try to use your saved_checkpoint.hdf5
, I also get an error when trying to load the model: ValueError: bad marshal data (unknown type code)
have you encountered this?
Context:
I have followed the instructions in the Readme file (download the latest checkpoint and placed it in the correct folder)
I tried to test the model on the validation set.
Error:
"Unable to Load Checkpoint."
if I print the exception at that except
statement I get the following error bad marshal data
Cause:
I think this problem is caused by the different python / tensorflow versions used to generate the model and in my runtime.
My versions are:
Solution:
I sovled the problem by running tensroflow 2.9.0 with python 3.7 in a docker container and saving the model as a "tensorflow saved model" Format instead of keras H5 Format. Now it works with the newer version of python.
Suggestion:
Add a tensorflow saved model format checkpoint to support more python/tensorflow versions.
PS: there was another problem while loading the model which is a missing 'k': K
in the custom_objects={...}
Hi Kartik,
When i' m trying to load the saved_checkpoint.hdf5 file, i'm getting below error looks like it is corrupted.
line of code : test_on_iam(show=True, partition="validation", checkpoint=checkpoint_path, uncased=True)
Error : from load_easter_model(checkpoint_path) function
KeyError: 'Unable to open object (bad heap free list)'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.