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

Image as an input #343

Open
ZauChoco opened this issue May 26, 2019 · 3 comments
Open

Image as an input #343

ZauChoco opened this issue May 26, 2019 · 3 comments

Comments

@ZauChoco
Copy link

Hello,

How to send an image as an input to make a prediciton ?

For example:
If I want to make a neural network to know if an image is red, how to send the image ?
In this case, it would be a buffer.

Thank you

@ghost
Copy link

ghost commented May 27, 2019

Read the RGB value of each pixel and feed each pixel as your input. Doing this with Javascript is very slow, so you should learn Tensorflow/Keras in combination with a top Nvidia card which has Tensorcores.

@ZauChoco
Copy link
Author

I tried, but each images don't have the same number of pixels, because of compression.
I could send everything in one input?
Prgb+P²rgb+P³rgb.......

For instant, I try with Javascript, but I will certainly change with another language.

@ghost
Copy link

ghost commented May 28, 2019

You can create Javascript code with Javascript to adopt your inputs to different pixel size, but that's more of a hack. You need to optimize and tune your neural network, for that you need static input size. Maybe define 3 models, small pix, medium and large pix and optimize each network. But that still will be slow in Javascript. Using Tensorflow you can be 100-1000x faster, limit ist just your hardware budget.

I recommend to read study this blog daily:
https://machinelearningmastery.com/blog/

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

1 participant