zhang0jhon / AttentionOCR

Scene text recognition
833 stars 259 forks source link

can the recognize model do with horizontal text? #36

Open LanWong1 opened 4 years ago

LanWong1 commented 4 years ago

image does the model work with the text image like this directly?

zhang0jhon commented 4 years ago

The model recognize padded square text image by default to support arbitrary-shaped image. If you only want to recognize horizontal text, you can modify the input image shape and retrain the model.

LanWong1 commented 4 years ago

The model recognize padded square text image by default to support arbitrary-shaped image. If you only want to recognize horizontal text, you can modify the input image shape and retrain the model.

sorry, I did not describe my question clearly. The horizontal text means the horizontal text detected in a square image

LanWong1 commented 4 years ago

I got it! firstly crop the text region, then resize and padding to 256, finally send the resized image to the model. while I think 256*256 is too large, this may cause large time costs

zhang0jhon commented 4 years ago

I use 256256 image with CNN stride 8, so the feature map size is 32 32, which is able to recognition 32 characters in horizontal or vertical line.

jjjjohnson commented 4 years ago

Hi @zhang0jhon : I think the 32*32 feature map size does not necessarily imply the model is able to recognition 32 characters in horizontal or vertical line. Based on this line it only depends on seq_len, which is predefined.