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

imageClassifier not working in v1.0.1 #183

Open
aswyatt opened this issue Aug 2, 2024 · 3 comments
Open

imageClassifier not working in v1.0.1 #183

aswyatt opened this issue Aug 2, 2024 · 3 comments

Comments

@aswyatt
Copy link

aswyatt commented Aug 2, 2024

The image classifier does not seem to be working in v1.0.1 - it returns the same results regardless of the image. I followed the tutorial on the getting started page. If I change the model, I get a different result (but always the same result for a given model with different images). The image classifier is working fine in version 0.12.

@ziyuan-linn
Copy link
Member

Hi @aswyatt, thank you for opening this issue!

Do you mind sharing your p5 sketch so we can narrow down the issue?

In the meantime, here is an example sketch for ImageClassifier that is working on my end: https://editor.p5js.org/ml5/sketches/pjPr6XmPY.
Feel free to try it out and let me know whether it works for you!

@aswyatt
Copy link
Author

aswyatt commented Aug 2, 2024

Sketch: https://editor.p5js.org/aswyatt/sketches/7XSXf4R0F

It's pretty much identical, and the problem appears to be the interaction with ML5 and Chrome, rather than the sketch. So if I run my sketch (or yours) on my phone (Android Chrome Beta 128.0.6613.14), they both worth fine, although I receive a warning "Initialization of backend webgpu failed ...", but it works. However, on my desktop in either Chrom (127.0.6533.89) or Edge (127.0.2651.74), it clearly does not classify the image for my script. I cannot run your script in Chrome - it says "TypeError: failed to fetch" when trying to load the image - there seems to be some kind of permissions issue. On Edge, yours runs but doesn't classify the image either (says its a spotlight).

@ziyuan-linn
Copy link
Member

Hi @aswyatt! Sorry for the late reply. Were you able to solve the problem?

I tried your sketch in Chrome on both Windows 11 and macOS and everything works fine. It also works in Edge on Windows. I'm using the same Chrome version as you, but I can't reproduce the error.

ImageClassifier running in p5 web editor

If you haven't already, perhaps try clearing your browser cache?

The "TypeError: failed to fetch" error on my sketch may be related to a p5 Web Editor CORS issue: processing/p5.js-web-editor#3156

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