Giter Club home page Giter Club logo

Comments (4)

faustomorales avatar faustomorales commented on July 20, 2024

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:

  1. Change print(frame.shape) to print("Frame Shape:", frame.shape). This will make the logging easier to read.
  2. 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.

Johndirr avatar Johndirr commented on July 20, 2024

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.

faustomorales avatar faustomorales commented on July 20, 2024

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.

Johndirr avatar Johndirr commented on July 20, 2024

Works like a charm now :)

from keras-ocr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.