Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async function loadModal() {
- const model = await tf_converter.loadFrozenModel(MODEL_URL, WEIGHTS_URL);
- // console.log(model);
- const predictedClass = tf.tidy(() => {
- const img = tf.fromPixels(document.querySelector("#pic"));
- const dimg = img.expandDims(0);
- console.log(img);
- console.log(dimg);
- console.log(model);
- const predictions = model.predict(dimg);
- return predictions.print();
- });
- console.log(predictedClass);
- }
- loadModal()
Advertisement
Add Comment
Please, Sign In to add comment