-
Notifications
You must be signed in to change notification settings - Fork 3
/
app.js
24 lines (21 loc) · 784 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var watson = require('watson-developer-cloud');
var fs = require('fs');
var visual_recognition = watson.visual_recognition({
api_key: '5dd5250c79742263cd33e095cc938d1a0952d690',
version: 'v3',
version_date: '2016-05-20'
});
var params = {
name: 'dogs',
beagle_positive_examples: fs.createReadStream('./src/watsonServices/beagle.zip'),
goldenretriever_positive_examples: fs.createReadStream('./src/watsonServices/golden-retriever.zip'),
husky_positive_examples: fs.createReadStream('./src/watsonServices/husky.zip'),
negative_examples: fs.createReadStream('./src/watsonServices/cats.zip')
};
visual_recognition.createClassifier(params,
function(err, response) {
if (err)
console.log(err);
else
console.log(JSON.stringify(response, null, 2))
});