Guest User

Untitled

a guest
May 18th, 2018
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. async function loadModal() {
  2.                 const model = await tf_converter.loadFrozenModel(MODEL_URL, WEIGHTS_URL);
  3.                 // console.log(model);
  4.              
  5.  
  6.                 const predictedClass = tf.tidy(() => {
  7.                     const img = tf.fromPixels(document.querySelector("#pic"));
  8.                     const dimg = img.expandDims(0);
  9.                     console.log(img);
  10.                     console.log(dimg);
  11.                     console.log(model);
  12.  
  13.                     const predictions = model.predict(dimg);
  14.                     return predictions.print();
  15.  
  16.                 });
  17.  
  18.                 console.log(predictedClass);
  19.  
  20.  
  21.             }
  22.             loadModal()
Advertisement
Add Comment
Please, Sign In to add comment