Google News
logo
ml5.js - Interview Questions
What is UNET in ml5.js?
The U-Net is a convolutional neural network that was developed for biomedical image segmentation at the Computer Science Department of the University of Freiburg, Germany.[1] The network is based on the fully convolutional network [2] and its architecture was modified and extended to work with fewer training images and to yield more precise segmentations.
 
UNET allows you to segment an image.
 
The ml5 unet face allows you to remove, for example, the background from video of the upper body of person.
 
Quickstart
// load your model...
const uNet = ml5.uNet('face');

// assuming you have an HTMLVideo feed...
uNet.segment(video, gotResult);

function gotResult(error, result) {
  // if there's an error return it
  if (error) {
    console.error(error);
    return;
  }
  // log your result
  console.log(result);
}
 
Usage
Initialize : 
const unet = ml5.uNet(model, ?callback);
Parameters : 

* model : A string to the path of the JSON model.

* callback : Optional. A callback function that is called once the model has loaded. If no callback is provided, it will return a promise that will be resolved once the model has loaded.
Advertisement