mathDR / reading-text-in-the-wild

A Keras/Theano implementation of "Reading Text in the Wild with Convolutional Neural Networks" by M Jaderberg et.al.
GNU General Public License v3.0
116 stars 30 forks source link

Getting Error while running use_dictnet.py #6

Closed rremani closed 7 years ago

rremani commented 7 years ago

Traceback (most recent call last): File "use_dictnet.py", line 62, in print (cnn_model.classify_image(img)) File "use_dictnet.py", line 49, in classify_image z = model.predict_classes(xtest,verbose=0)[0] NameError: global name 'model' is not defined

With use_charnet.py didnt have any problem.

mathDR commented 7 years ago

Sorry, I haven't looked at this in a while. Can you try

z = self.model.predict_classes(xtest,verbose=0)[0]

I think predict_classes is a keras function, so it would be an object call from model.

rremani commented 7 years ago

Hi, Thanks for reply actually I tried the same thing after thinking for a while and it worked.

I am actually working on recognizing text from natural scenes, since you have provided two different models, one using char and one with dict, so I was thinking will it be a wise thing to train char net on character dataset and use it for predicting text blobs from natural scene images.

If you could put some thoughts would be helpful. Thanks

mathDR commented 7 years ago

@rremani The Jaderberg paper discusses how to do exactly this. The current repo is only the charnet portion of the entire pipeline. The datasets at the website in the paper (the synth dataset) allows for training with unlimited labeled images (as it is able to generate new ones on demand).

Once this is trained, it should be placed in the pipeline for natural text extraction

rremani commented 7 years ago

Thanks a lot!