ibm-watson-cognitive 训练自定义分类器
示例
训练自定义分类器需要将图像的语料库分组。在这个例子中,我有一个ZIP文件一大堆苹果的图像,在另一个ZIP文件一串香蕉的图像,和第三组的东西都是图片不是水果的负组。创建自定义分类器后,它将处于状态training,您必须使用分类器ID来检查其是否准备就绪(使用“获取有关特定自定义分类器的信息”示例)。
'use strict';
let watson = require('watson-developer-cloud');
let fs = require('fs');
var visualRecognition = watson.visual_recognition({
version: 'v3',
api_key: process.env.API_KEY,
version_date:'2016-05-19'
});
let custom_classifier = {
apple_positive_examples: fs.createReadStream('./apples.zip'),
banana_positive_examples: fs.createReadStream('./bananas.zip'),
negative_examples: fs.createReadStream('./non-fruits.zip'),
name: 'The Name of My Classifier'
}
visualRecognition.createClassifier(custom_classifier, function(error, results) {
console.log(JSON.stringify(results,null,2));
});
热门推荐
10 祝女儿简短祝福语大全
11 大学新年祝福语简短创意
12 元旦适合的祝福语简短
13 朋友出远门祝福语简短
14 初六简短的祝福语
15 祝男孩生日祝福语简短
16 同事调离的祝福语简短
17 拜年红包的祝福语简短
18 妈妈生日祝福语简短励志