You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an example image and label it to train the ImageClassifier
Parameter
Description
Type
Memory
label
Category label for what the image is
String
True
image
Path to image or raw image data to add as an example for the label
String
True
Example:
// Add Toyota Examples from pathawaitclassifier.addExample('Toyota','./toyota0.png');awaitclassifier.addExample('Toyota','./toyota1.png');awaitclassifier.addExample('Toyota','./toyota2.png');// Add Toyota Example from raw imageconsttoyotaRawImage=fs.readFileSync('./toyota3.png');awaitclassifier.addExample('Toyota',toyotaRawImage);/* ...Add more examples */// Add Honda Examplesawaitclassifier.addExample('Honda','./honda0.png');awaitclassifier.addExample('Honda','./honda1.png');awaitclassifier.addExample('Honda','./honda2.png');// Add Honda Example from raw imageconsthondaRawImage=awaitfs.promises.readFile('./honda3.png');awaitclassifier.addExample('Honda',hondaRawImage);/* ...Add more examples */
Path to image or raw image data for evaluating a prediction with your ImageClassifier
String
True
Example:
// Predict by image pathconstprediction1=awaitclassifier.predict('./toyotaTest0.png');// Predict by raw imageconsttoyotaTestRawImage=fs.readFileSync('./toyotaTest1.png');constprediction2=awaitclassifier.predict('./toyotaTest1.png');