Comments (4)
It looks like you aren't checking for the video ending. So I suspect that this is working fine up until the point where the video ends, at which point ret
will be False
.
Immediately after ret, frame = cap.read()
, you should check for the video being over by doing:
if not ret:
break
If this does not fix it, please do the following to help with debugging the issue:
- Change
print(frame.shape)
toprint("Frame Shape:", frame.shape)
. This will make the logging easier to read. - Run your script and provide the 15 (or some other reasonable number) lines that are printed before the exception is raised, along with the traceback, as you have above.
from keras-ocr.
The shape is fine: (480, 640, 3) and it's the first frame of the video. Thinking about it I think I know whats wrong. I can't test it right now but I think whats happening is, that the frame has no text at all and since I use pipeline.recognize
it awaits a result after the detection to feed it to the recognizer. I was about to check if text was detected only after I get predictions.
Will test this in time.
from keras-ocr.
You are 100% right. This happens whenever no text is detected in the image. I've pushed 5c1cb4f which fixes the issue and adds a test with a blank image to make sure this doesn't break again in the future. The fix is implemented in v0.6.2, which I've just published. Please try again with the updated version and let me know if the issue persists.
from keras-ocr.
Works like a charm now :)
from keras-ocr.
Related Issues (20)
- Loading trained model doesn't work in new session - shape mismatch error.
- Can load pretrain custom digits model
- Predicted result strings are empty --> Predicted: ['', '', '', '', '', ''] HOT 1
- how to add keras-ocr new model?
- Error when training detector with batch size > 1
- local variable "image" out of scope in keras-ocr/tools.py
- Keras_ocr library not detecting specific texts from the image
- Please Help i cant display the evaluation score after prediction
- How to predict numbers only? HOT 1
- Evaluation of my model HOT 2
- Python 3.10 support HOT 2
- What version of matplotlib are you guys using?
- Could not download HOT 1
- Very inaccurate results with keras-ocr tflite model HOT 1
- Cannot train Recognizer - ValueError: Exception encountered when calling layer 'lambda_1' (type Lambda). HOT 5
- "Tried to convert 'num' to a tensor and failed. Error: None values not supported." HOT 1
- 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
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.