danwald / pytextractor

python ocr using tesseract/ with EAST opencv detector
MIT License
42 stars 19 forks source link

Pytextractor : Error OpenCV(4.4.0) (-215:Assertion failed) inputs.size() == requiredOutputs in function 'cv::dnn::dnn4_v20200609::DataLayer::getMemoryShapes' #9

Closed BS-Keerthana closed 1 year ago

BS-Keerthana commented 2 years ago

Hi,

While trying to use pytextractor to detect text from images, am getting below error. Please suggest.

Package Version opencv-python==4.4.0.46 tesseract v5.0.0.20211201

Code : from pytextractor.pytextractor import PyTextractor

extractor = PyTextractor() detected = extractor.get_image_text(imagepath, number=True)

Error:

[ERROR:0] global C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-nxx381if\opencv\modules\dnn\src\dnn.cpp (3444) cv::dnn::dnn4_v20200609::Net::Impl::getLayerShapesRecursively OPENCV/DNN: []:(_input): getMemoryShapes() throws exception. inputs=1 outputs=0/0 blobs=0 [ERROR:0] global C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-nxx381if\opencv\modules\dnn\src\dnn.cpp (3447) cv::dnn::dnn4_v20200609::Net::Impl::getLayerShapesRecursively input[0] = [ 1 3 320 320 ] [ERROR:0] global C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-nxx381if\opencv\modules\dnn\src\dnn.cpp (3457) cv::dnn::dnn4_v20200609::Net::Impl::getLayerShapesRecursively Exception message: OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-nxx381if\opencv\modules\dnn\src\dnn.cpp:784: error: (-215:Assertion failed) inputs.size() == requiredOutputs in function 'cv::dnn::dnn4_v20200609::DataLayer::getMemoryShapes'

Error OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-nxx381if\opencv\modules\dnn\src\dnn.cpp:784: error: (-215:Assertion failed) inputs.size() == requiredOutputs in function 'cv::dnn::dnn4_v20200609::DataLayer::getMemoryShapes'

danwald commented 2 years ago

can you please provide me with the image you are using so I can help debug?

On Fri, Dec 24, 2021 at 11:29 AM BS-Keerthana @.***> wrote:

Hi,

While trying to use pytextractor to detect text from images, am getting below error. Please suggest.

Package Version opencv-python==4.4.0.46 tesseract v5.0.0.20211201

Code : from pytextractor.pytextractor import PyTextractor

extractor = PyTextractor() detected = extractor.get_image_text(imagepath, number=True)

Error:

[ERROR:0] global C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-nxx381if\opencv\modules\dnn\src\dnn.cpp (3444) cv::dnn::dnn4_v20200609::Net::Impl::getLayerShapesRecursively OPENCV/DNN: []:(_input): getMemoryShapes() throws exception. inputs=1 outputs=0/0 blobs=0 [ERROR:0] global C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-nxx381if\opencv\modules\dnn\src\dnn.cpp (3447) cv::dnn::dnn4_v20200609::Net::Impl::getLayerShapesRecursively input[0] = [ 1 3 320 320 ] [ERROR:0] global C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-nxx381if\opencv\modules\dnn\src\dnn.cpp (3457) cv::dnn::dnn4_v20200609::Net::Impl::getLayerShapesRecursively Exception message: OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-nxx381if\opencv\modules\dnn\src\dnn.cpp:784: error: (-215:Assertion failed) inputs.size() == requiredOutputs in function 'cv::dnn::dnn4_v20200609::DataLayer::getMemoryShapes'

Error OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-nxx381if\opencv\modules\dnn\src\dnn.cpp:784: error: (-215:Assertion failed) inputs.size() == requiredOutputs in function 'cv::dnn::dnn4_v20200609::DataLayer::getMemoryShapes'

— Reply to this email directly, view it on GitHub https://github.com/danwald/pytextractor/issues/9, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFIBNQDBTFPUZKHHWZUSNTUSQONLANCNFSM5KWF2KXA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

danwald commented 1 year ago

just upgraded the libs hope this fixes your issue ... reopen if it doesn't cheers