title: How to classify image using custom model in tensorflow.js?
body: <p>The script that builds and trains the model looks like this:</p>
  
  <pre><code>const model = tf.sequential();
  
  model.add(tf.layers.conv2d({
    inputShape: [160, 200, 3],
    filters: 32,
    kernelSize: 3,
    activation: 'relu',
  }));
  
  model.add(tf.layers.flatten());
  
  model.add(tf.layers.dense({units: labels.length, activation: 'softmax'}));  
  
  model.compile({
    optimizer: 'sgd',
    loss: 'categoricalCrossentropy',
    metrics: ['accuracy']
  });    
  
  const info = await model.fitDataset(ds, {epochs: 5});
  console.log('Accuracy:', info.history.acc);
  
  console.log('Saving...');
  await model.save('file://' + MODEL_PATH);
  console.log('Saved model');
  </code></pre>
  
  <p><code>ds</code> consists of images and labels. For 100 images I get these results:</p>
  
  <p><code>4478ms 135692us/step - acc=0.109 loss=14.37</code></p>
  
  <p>and it produced a 20 MB weights.bin file...</p>
  
  <p>Frankly, I have no idea if that's good or not because I don't know how to use it classify new images.</p>
  
  <p>I know how to load the model:</p>
  
  <pre><code>const model = await tf.loadLayersModel('file://' + MODEL_PATH + '/model.json');
  </code></pre>
  
  <p>but that's it.</p>
  
  <p>mobilenet has a <code>.classify</code> method to which I can just pass an image and it outputs the predicted laabel. But this is not available on the model object.. So how do I proceeed?</p>