I am working on using a convolutional neural network in a website that I am developing but am unsure how to create an input for an image.
The CNN model was trained in keras and then converted to a tensorflow.js format and is loading without problem. However, when I am trying to use an image as an input with the tf.fromPixels method within tensorflow.js, I am experiencing an issue stating:
"Uncaught DOMException: Failed to execute 'texImage2D' on 'WebGL2RenderingContext': The image element contains cross-origin data, and may not be loaded."
The image itself is locally stored and being shown in the webpage (the entire page is just being run locally at the moment). How would I go about feeding an image into the tensorflow.js CNN model? Is there anyways to use a local image through an html <img/> tag or does it have to be hosted online? My guess is that the fromPixels() method is causing a CORS error but I'm unsure if thats certainly the case and anyways around it.