Git Product home page Git Product logo

Comments (13)

kayhayen avatar kayhayen commented on June 6, 2024

Can you try your minimal example with --include-package-data on the package that contains the data file?

from nuitka.

StefanJordan avatar StefanJordan commented on June 6, 2024

Thank you very much for your feedback! With --include-package-data=easyocr it worked.
Do you know why my MacBook Pro (13-inch, M1, 2020, Chip Apple M1, Memory 16 GB, macOS Sonoma 14.2.1) takes 42 seconds to launch the program?

Is there a rule for which packages the -include-package-data statement is necessary?

The main program that I aim to compile is generating an error. This error doesn't occur when running the Python interpreter. Before sharing the details here, I need to conduct a thorough analysis of the circumstances in which the error arises.

from nuitka.

StefanJordan avatar StefanJordan commented on June 6, 2024

After Kay Hayen helped me to solve the first problem, I encountered another issue. As stated before, I encountered an error message when I compiled my main program with Nuitka. I pinpointed the problem using this simplified and concise Python script:
import easyocr
import imageio.v2 as imageio
reader = easyocr.Reader(['de'])
panel = imageio.imread("panel.jpg")
extracted_text_list = reader.readtext(panel, detail=0, paragraph=True, y_ths=-0.05)
print(extracted_text_list)

In Python, this script successfully prints the extracted list of text. However, when I translated the program using Nuitka on my Mac, I received the following error message:
extracted_text_list = reader.readtext(panel, detail=0, paragraph=True, y_ths=-0.05)
File "/private/var/folders/97/2hhk78996sl6dtlhx5wrhl4m0000gp/T/onefile_90454_1706025419_107628/easyocr/easyocr.py", line 454, in readtext
File "/private/var/folders/97/2hhk78996sl6dtlhx5wrhl4m0000gp/T/onefile_90454_1706025419_107628/easyocr/utils.py", line 767, in reformat_input
ValueError: Invalid input type. Supporting format = string(file path or url), bytes, numpy array

The behavior differs significantly from the original Python program. Can someone explain why this discrepancy occurs in the Nuitka version?

I am aware that an alternative solution is to use:
extracted_text_list = reader.readtext("panel.jpg", detail=0, paragraph=True, y_ths=-0.05)

However, due to performance considerations and the fact that the jpg file is generated in memory, I prefer not to save it to disk.

from nuitka.

kayhayen avatar kayhayen commented on June 6, 2024

Yes, @KevinRodriguez777 is on this in another issue already, I wasn't immediately sure of that, maybe share the issue number here, I had no easy finding for it

from nuitka.

StefanJordan avatar StefanJordan commented on June 6, 2024

Can you please clarify whether @KevinRodriguez777 is actively working on addressing the reported issue or if there is another separate issue related to the same topic? The addition of the "duplicate" label suggests the presence of a similar problem, but I couldn't locate the corresponding duplicate issue.

from nuitka.

KevinRodriguez777 avatar KevinRodriguez777 commented on June 6, 2024

Can you please clarify whether @KevinRodriguez777 is actively working on addressing the reported issue or if there is another separate issue related to the same topic? The addition of the "duplicate" label suggests the presence of a similar problem, but I couldn't locate the corresponding duplicate issue.

It’s been worked on. I will do a PR either later today or tomorrow morning.

from nuitka.

KevinRodriguez777 avatar KevinRodriguez777 commented on June 6, 2024

@kayhayen i believe you're confusing it with #2619 which is for paddleOCR, they're separate libraries.

from nuitka.

kayhayen avatar kayhayen commented on June 6, 2024

I see, pardon my mistake, this is now on develop and will be in 2.0 shortly.

from nuitka.

kayhayen avatar kayhayen commented on June 6, 2024

This is part of the stable release 2.0 that I just made.

from nuitka.

StefanJordan avatar StefanJordan commented on June 6, 2024

Thank you very much Kay! With the stable release 2.0 it worked. This is really great!

I will not check whether the main program works.

On my Mac this simple program takes 42 seconds to load. Is this normal behaviour?

from nuitka.

kayhayen avatar kayhayen commented on June 6, 2024

I don't think that is normal, usually it takes 42 hours.

from nuitka.

StefanJordan avatar StefanJordan commented on June 6, 2024

Thanks for the joke. Honestly, I want to know whether anything is wrong on my side. The program is 200 MB in size and takes so long to load. The program takes five seconds to launch when using Python. I am not sure whether my Mac checks the file for not being malware every time I call it. Maybe it is not a question that I should ask here.

I appreciated your prompt assistance with my easyocr matter very much and was delighted to receive such swift help.

I have another concern related to adding a picture to my Mac. Should I initiate a new thread for this topic, or can I pose my straightforward question here?

from nuitka.

kayhayen avatar kayhayen commented on June 6, 2024

App bundles should launch immediately as they do not have unpacking. Create a new issue for slow startup, but please try and isolate it on your side, like with a print at program start before any import, etc. and running the app from the console so you see the output. For "picture", yes new issue, always new issue, only one topic per issue is how to make sure nothing gets lost.

from nuitka.

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.