So I am new to ml and working on automl, it is showing prediction online a lot better but the problem is that I need an offline solution, so I am deploying the model on edge Tensorflow once I trained the model and download it offline. I got a label txt file, 3 bin files and 1 model file which is JSON file format.
I did read this Google Edge Vision but I still can't seem to get my model working, as this link show we have to make an index.html file I did copy-paste the same code and made an Html file but I don't want to load image from google storage, so I gave the path of an image in the same folder as the index.html file and remove the cross-origin but still, it is just showing the image not the probability of detecting the image or anything like that, and yes I did open Http.server 8080 with python so no problem with that
<script src="https://unpkg.com/@tensorflow/tfjs"></script>
<script src="https://unpkg.com/@tensorflow/tfjs-automl"></script>
<img id="detect" src="1.png">
<script>
async function run() {
const model = await tf.automl.loadImageClassification('model.json');
const image = document.getElementById('detect');
const predictions = await model.classify(image);
console.log(predictions);
// Show the resulting object on the page.
const pre = document.createElement('pre');
pre.textContent = JSON.stringify(predictions, null, 2);
document.body.append(pre);
}
run();
</script>
Can anyone help me out what should I do I have already searched many internet forums but can't find the answers