Skip to content
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

Can't get it to work. Just getting blurred image right after clicking the icon on the address bar #25

Closed
himouto opened this issue Jan 25, 2024 · 14 comments
Assignees

Comments

@himouto
Copy link

himouto commented Jan 25, 2024

I'm using run_server-gpu version. The fields are color green but when I click the icon on the address bar nothing happens just blurred image.

I'm getting this error when using kha-white/manga_ocr_base: "Could not find image processor class in the image processor config or the model config. Loading based on pattern matching with the model's feature extractor configuration." so I tested tesseract and the results are the same.

I tested the cpu version and same results - after clicking the add-on icon on the address bar nothing happens it just blurs the
image. Tried refreshing the tab while the icon is green still no translation - just blurred image with red outline. Check screenshot below:

Screenshot 2024-01-25 133030

@himouto
Copy link
Author

himouto commented Jan 25, 2024

Some additional info:
Recently updated Firefox to 122 and NVIDIA GPU driver to 551.23

Not sure if it's hardware related or the recent gpu driver itself since I also tried the cpu version and got the same results - the add-on just blurs the image and doesn't return any translation. I tried waiting for over 5 minutes and also tried refreshing the tab while the icon is still green.

@Crivella
Copy link
Owner

Hi @himouto thanks for opening this issue.

Would it be possible for you to attach also the log shown in the server window?
Ideally with the environment variable DJANGO_LOG_LEVEL set to DEBUG, but also the basic one would help.

Need to understand what is going on as it is kind of weird that also tesseract would give you the same error.

Also i assume you are running using the release file. (I see you can see the advanced options tab in the extension and languages written in extended format so it should be the latest version). Is this your first time trying to run the server or did it ever work for you before with previous versions?

@Crivella Crivella self-assigned this Jan 25, 2024
@himouto
Copy link
Author

himouto commented Jan 26, 2024

Screenshot 2024-01-26 075933

@Crivella
Copy link
Owner

I will have to investigate and try to reproduce the bug, in my case starting from a fresh install of the server (using the release file v0.5.1) it seems to be working fine.
The error you see I think is due to some update to the online model, but it's not relevant. (You can see it in my log as well)

image

image

It is kind of weird you don't even see the beginning of the translation starting, but it shouldn't be a a firewall issue since you are able to set the language and models properly

One thing you could try is delete the %userprofile%/.ocr_translate folder and try to start the server

PS: that website does have images that have place-ins replaces by JS when you scroll over them, i still have to implement handling of this in the extension as well

@Crivella
Copy link
Owner

PS: This would really help, could you give me the result of the following (see screenshot for help, in my case i simulated a server error by not loading any models):

  • Start the server
  • Go to the page you want to translate
  • Press F12
  • Click on console
  • Start the translation
  • Once the red border appears there will be some log of the errors
    • Expand the last object
    • Expand response
    • Either copy here the entire thing or at minimum, the data field that contains the error being sent from the server to the extension

image

@himouto
Copy link
Author

himouto commented Jan 26, 2024

Screenshot 2024-01-26 114348

Can't see a response in the console. I did a fresh re-install of the add-on and it's still the same - after "GET / HTTP/1.1 200 3776" line in the server window it gets stuck there. I'm using the latest nvidia driver which just updated 2 days ago if that changes anything and Python 3.10.6 for my A1111 stable diffusion setup. Also I can access http://127.0.0.1:4000 just fine so it isn't a local network problem

@himouto
Copy link
Author

himouto commented Jan 26, 2024

Tested with tesseract:
Screenshot 2024-01-26 123557

Also no response under request. Is there any chance ublock is behind this like it's blocking the addon functions not the manga website since I tested turning it off for this site but same results

@himouto
Copy link
Author

himouto commented Jan 26, 2024

There's no >response under Object. I only see >config, >request and >prototype. In the server window it's stuck on "django.server.basehttp - "GET / HTTP/1.1"" - tried waiting it out for over 10 minutes. I have a decent hardware RTX 3070 with the latest driver so it shouldn't take that long.

@Crivella
Copy link
Owner

Crivella commented Jan 26, 2024

So I can tell it' not a problem with

  • drivers version
  • firefox version
  • ublock

as i am running the same.

Also no point in waiting, once there is a red corner it means there was an error (only blurred with no border means it is still doing something)

From what you have shown, it looks like the popup.js script is working fine (the one that is doing the setting of the language and models) but the content.js is not (the one running in the activated tab and grabbing and sending images to the server).

Weirdly enough you don't even get the URL in the request you have shown (I can simulate the same error by running the translation without the server open, but i see the URL where the image would be sent)

image

I think something is blocking communication between the content.js and background.js/popup.js scripts because the endpoint is blank at the start but is set the first time you open the popup (the menu you get when you click on the extension).
(Note i can say atleast it should not be the doing of noscript if you are running that as i tried that as well, can't say for other extensions)

I will check this evening what could be causing this and get back at you

@Crivella
Copy link
Owner

Crivella commented Jan 26, 2024

If you don't mind could you right click on the trace object and click Copy Object and paste the result here, i want to check also the content of the config part where you should be able to see the URL being used.

Unfortunately I am not sure the problem is what i was thinking before.
If it was just communication between the extension components and the ENDPOINT was empty you should get a domain exception because of trying to open undefined/run_ocrtsl/ as an URL (simulated by running a modified version of the extension where i manually introduced the error).

Unfortunately without having the system under my hand or being able to reproduce the bug it is kind of hard to get to the root of it.
Given the server log you have shown I can for sure that requests for translation are never reaching it.
Either the extension is doing something wrong and not managing to send a request, or something external is blocking requests being sent by content.js but not popup.js.

On a side note, other version of python and installed packages you have on your system should not affect the server regardless as it is made with a frozen installer (PyInstaller) and comes with it's own version of python and dependencies already installed (Might change this in the future as it makes having a plugin manager where users a difficult problem)

@himouto
Copy link
Author

himouto commented Jan 27, 2024

Figured it out. It was uBlock Origin, I disabled it and restarted the server window and it's now working properly

Screenshot 2024-01-27 083526

Now to figure out why it's doing this... I tried whitelisting 127.0.0.1 and 127.0.0.1:4000 on ublock's Trusted sites but it's still breaking the extension

I'm getting these errors on console when ublock is enabled.. not sure if they're related

Screenshot 2024-01-27 083754

@himouto
Copy link
Author

himouto commented Jan 27, 2024

Disable Javascript is not enabled on my ublock settings so idk what's causing this... not sure if any of the Filters are the culprit but completely disabling the extension temporarily fixes the issue
Screenshot 2024-01-27 085631

@Crivella
Copy link
Owner

Good that you figured it out.
Weird that it was uBlock as I also have it and never had to add any whitelisting for it work.

The other errors you've shown are not related.
What is being blocked is not the JS itself but the XHR request from the extension to the server.

One possible long term solution would be for me to modify the extension so all XHR requests are originating either from the background.js or popup.js which other extension should not be able to interfere with (content.js is injected and running inside the tab).

For now I will mark this as closed and add a note in the README.

Feel free to open a new issue or rewrite here in case something else comes up.

Hope you will enjoy the extension

@himouto
Copy link
Author

himouto commented Jan 27, 2024

Thank you for the help. It's a very good extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants