Comments (4)
First, thanks for trying out the package!
Getting detection to work well in this case is relatively easy but improving recognition will take more work.
On detection, because the text is so small upscaling is very important. The default upscaling of 2x works but because the image is so tall, you hit the default max_size
limit too soon. I found setting that parameter to 4096 to be enough to get high quality text detection.
import matplotlib.pyplot as plt
import keras_ocr
image = keras_ocr.tools.read(
'https://user-images.githubusercontent.com/25033310/74313656-fece6500-4d6b-11ea-8fae-082421897241.jpg'
)
pipeline = keras_ocr.pipeline.Pipeline(max_size=4096)
predictions = pipeline.recognize([image])[0]
fig, ax = plt.subplots()
keras_ocr.tools.drawAnnotations(image=image, predictions=predictions, ax=ax)
The bounding boxes look pretty good -- but the text recognition is quite poor. To fix this, I think you'll need to get a dataset together of text that looks like that in your use case to train a custom recognizer. The good news is that it is much easier to train the recognizer than the detector! There's an example for fine tuning the detector in the documentation which I think you may want to adapt.
I'm going to close this now because it is not so much a bug in the package as it is a how-to question which I believe my comments above answer. If you run into problems with the example or with training the recognizer in general, please open a new issue.
from keras-ocr.
I forgot to run your second example, but that one actually does a little better.
import matplotlib.pyplot as plt
import keras_ocr
image = keras_ocr.tools.read(
'https://user-images.githubusercontent.com/25033310/74313659-ffff9200-4d6b-11ea-907e-89bd0459f275.jpg'
)
pipeline = keras_ocr.pipeline.Pipeline(max_size=4096)
predictions = pipeline.recognize([image])[0]
fig, ax = plt.subplots()
keras_ocr.tools.drawAnnotations(image=image, predictions=predictions, ax=ax)
from keras-ocr.
from keras-ocr.
Yes, that's correct -- it appears that you will need to obtain some real-world labeled data to train the recognizer for this use case.
from keras-ocr.
Related Issues (20)
- Can I get Korean Text from Image? Using keras-ocr HOT 1
- Open Source License HOT 1
- Adding an example for fine-tuning both detector & recognizer using an your own dataset HOT 4
- Detecting vertical text with craft HOT 3
- Can I extract the text color too?
- Error while import package
- How can I load the models in an offline environment? HOT 1
- Finetuning the recognizer crashes when reaching the fit_generator method
- README.md has 3 image links for running OCR. Second image is not available.
- Text bbox transform
- Train the recognizer
- Filling up RAM
- unable to load fonts. There is some issue not loading fonts while end-to-end training. HOT 1
- Small Issue With Letter Recognition
- is there a way to skip download data_generation.get_backgrounds and data_generation.get_fonts
- tensorflow is missing from requirements
- Readme.md issue
- Pipeline constructor initializing libiomp5 multiple times
- Cannot Download Pipeline: Unrecognized keyword arguments passed to Dense HOT 2
- -
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keras-ocr.