Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Howto use to recognize images with texts? #3

Open
jmokoistinen opened this issue Feb 16, 2016 · 2 comments
Open

Howto use to recognize images with texts? #3

jmokoistinen opened this issue Feb 16, 2016 · 2 comments

Comments

@jmokoistinen
Copy link

Used this data for training. I got alpha_iter_1300.caffemodel and alpha_iter_1300.solverstate. (etc 1200, 1100, ... 100)
How can I use it to recognize images with text?

@twmht
Copy link

twmht commented Jul 13, 2016

I just write a python interface to do that.

import caffe
import numpy as np

img = caffe.io.load_image( "AndaleMono-6-4.png" )
img = img[:,:,::-1]*255.0 # convert RGB->BGR
img = img.transpose((2,0,1))
img = img[None,:] # add singleton dimension
net = caffe.Net("alpha_deploy.prototxt","alpha_iter_1300.caffemodel",  caffe.TEST)
out = net.forward_all( data = img )
prob = net.blobs['prob'].data[0]
index = np.argmax(prob)

where AndaleMono-6-4.png comes from one of the image in training images.

but it shows


F0713 16:57:02.346405 23560 net.cpp:765] Cannot copy param 0 weights from layer 'ip2'; shape mismatch.  Source param shape is 62 500 (31000); target param shape is 36 500 (18000). To learn this layer's parameters from scratch rather than copying from a saved net, rename the layer.

I am trying to figure out what the problem is.

@shendaizi
Copy link

@twmht where you put the script you wrote?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants