-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Input image dimension requirements unclear #2
Comments
Hi! Just to give you a feedback: I was in a conference these last weeks, I just came back. Within a few days I'll take a look and help you! |
Meanwhile, can you give examples of your images? @32-git |
Hi! Thanks for the reply and my apologies if i disturbed you. My images may look something like this or this The width of the image may vary as shown above, based on the browser window size when drawing. Now I would genuinely appreciate it if you could let me know whether these images are fine. If not, what should I pay attention to when passing the images to the model? |
Hi! Don't worry, it's ok to ask me some help. I'll try to use your images. Did you take a look carefully at the code I used as example? I'll let you know my results and see what the problem is But apparently these images should be fine |
Great! If the images should be fine, that's a good start. I have in fact looked at your example code and that's what I based my approach off of:
As I said, the error that I mentioned in my first message is what I receive. Although if it helps I could also paste the entire output I get, which shows all the steps of when the code executes. |
Hello, I ran the "example.py" with your first image and I had the correct output: I added both images to: And, then I ran:
For simplicity, I didn't create another project importing mathreader.
In your case, you should install it directly by pip(3) install mathreader... Now, I will test it with your code. But now we know that your images are compatible with the application |
This code worked with your images: teste.py
Running: |
Hi thanks a lot for your patience. Relieved to hear that it works. I tried your code out, but I changed one thing about it. In my project, I receive a base64 string directly from my app which i then send to the python script. Therefore, I skipped the part where you convert the image to b64 and just went straight to the "header, encoded" part. But I still somehow received an error:
...
[bunch of references to files]
I shortened the error to what I thought were the most important bits. Is there any chance you get what's going on here? |
@32-git I know it's a bit long, put can you give me the output/value of the encoded image? |
About tensorflow... I don't know why you're having this issue. But here they comment about it: https://stackoverflow.com/questions/77921357/warning-while-using-tensorflow-tensorflow-core-util-port-cc113-onednn-custom |
@carolreis
|
Maybe this error output can help too?
|
Oh, God. It reminds me I need to improve these logs urgently... I'll make a test with your base64 and let you know what I found |
Hi @carolreis Were you able to make any progress with the base 64 string? |
SAME PROBLEM WITH ME :(( PS I:\ML\MATH\mathoku> & "C:/Program Files/Python311/python.exe" i:/ML/MATH/mathoku/mathreader/test.py ['i:/ML/MATH/mathoku/mathreader/test.py'] [recognize.py] to_recognize | Starting image preprocessing... [preprocessing.py] treatment() [recognize.py] to_recognize | Image preprocessing finished. [recognize.py] to_recognize | Starting symbol classification... ... segmentation ... |
Hi, guys! Sorry I didn't have time to take a look at this. I'll make an effort to look at it this week! I'll have to debug it more deeply because using the same images you gave me, it is working here... |
Hello again, Carol. I hope you're doing well. Would it be possible for you to re-share the final working version of the project along with the relevant data files? Thank you very much! |
Hello. Could you share with me you repo? If you don't want to share here, send me an email: [email protected] |
@mustafa-senyuz Hi. I'm deeply sorry for not seeing it before. I am going to the at look at this right now. Would mind sending me your repo so I can test here? Don't worry about your project, I care a lot about ethics and I wouldn't use it for any purpose besides helping you. It will help us to see if the problem is with your code or maybe something related about how you install your libraries and so on. |
Testing the last base64 here: Did you notice this warning?
I don't have it here. Maybe set this env variable to see if it works |
I used the example.py file and modify to use the base64 string (a really hard-coded test):
Important: Notice that, for a base64 string, I had to put the string in a list:
Since in the example, it iterates over the "images" variable. And I had to change the parameter to data=type=base64 as well |
Let me see yout installed version of these libraries:
|
@mustafa-senyuz @32-git Hi! Could you try to do the things I mentioned in my previous comments? I really wanna help you |
First of all, thank you very much for your interest, Caroline. Actually, I haven't developed a new project, I'm just trying to get yours to work. I have made the latest updates and the relevant new library list is as follows. I also ran example.py exactly according to the base64 code you sent. But unfortunately I'm getting the same error. And let me show you the relevant lib. and output: idx2numpy PS I:\ML\MATH\mathoku> & "C:/Program Files/Python311/python.exe" i:/ML/MATH/mathoku/mathreader/example2.py ['i:/ML/MATH/mathoku/mathreader/example2.py'] [recognize.py] to_recognize | Starting image preprocessing... [preprocessing.py] treatment() [recognize.py] to_recognize | Image preprocessing finished. [recognize.py] to_recognize | Starting symbol classification... ... segmentation ... |
@mustafa-senyuz I asked a friend of mine to test it. And it worked for him as well. However he said he had to update the python version to 3.7 - he was using 3.1 |
Ok I will test with other versions too. |
@mustafa-senyuz |
Do you have any dockerfile for this project? yeah maybe the problem is
windows. I will can try it on docker.
13 Kas 2024 Çar 13:36 tarihinde Caroline Reis ***@***.***>
şunu yazdı:
… @mustafa-senyuz <https://github.com/mustafa-senyuz>
I noticed you are using windows, I am worried abuot something related to
installation.
Would mind trying to use a docker with a linux image, such as ubuntu?
—
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A27BZK2GUBPYBWCIDKLPORT2ANBTXAVCNFSM6AAAAABOD22NRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZTGQ4TCMBTGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Unfortunately I don't have it. But I believe it might work with that |
:)) ok
14 Kas 2024 Per 17:47 tarihinde Caroline Reis ***@***.***>
şunu yazdı:
… Unfortunately I don't have it. But I believe it might work with that
—
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A27BZK4C35344XVNDPOYMPL2ATH33AVCNFSM6AAAAABOD22NRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINZWHEZDMOJUG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@mustafa-senyuz hi, did you try it? |
@carolreis |
@mustafa-senyuz @32-git keras==2.13.1 |
Yeah yeah, I also assumed that it was due to problems with the models. In
fact, Tensorflow and Keras cause serious problems for some Python versions
on Windows.One module matches your version of Python, while the other does
not. Which version of Python are you using? And what is your operating
system and version? I would be very happy if you tell me these. I
actually think you're caring about the problem too much. I would like to
express my gratitude.
25 Kas 2024 Pzt 14:09 tarihinde Caroline Reis ***@***.***>
şunu yazdı:
… @mustafa-senyuz <https://github.com/mustafa-senyuz> @32-git
<https://github.com/32-git>
A friend of mine had the same issue due to the keras version.
He changed to the same I have and it worked:
keras==2.13.1
tensorflow==2.13.1
tensorflow-estimator==2.13.0
tensorflow-io-gcs-filesystem==0.34.0
Python 3.8.10
—
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A27BZK3GXIXW2EOPSTBF2XL2CMOO5AVCNFSM6AAAAABOD22NRSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJXHE4DANZRG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi. I am using this repo as a part of my project. And I am currently having a problem with the dimensions of the image I pass to the HME recognizer.
If I use the original image size, I get the following error:
Exception: Kernel shape must have the same length as input, but received kernel of shape (3, 3, 1, 32) and input of shape (None, None, 28, 28, 1).
In my attempts to resize the image, I have to go down to sizes such as 120x120 to avoid getting the above error. But when I go down to that image size, then the handwritten math is barely recognizable.
So instead of constantly guessing, I wanted to know what the actual requirements of the model are regarding image size and whether it would be possible to pass larger images (e.g. 600x600) to the model as well.
Thanks in advance!
The text was updated successfully, but these errors were encountered: