17. Python
import json
from os.path import join, dirname
from os import environ
from watson_developer_cloud import VisualRecognitionV3
visual_recognition = VisualRecognitionV3('2016-05-20', api_key='{api_key}')
with open(join(dirname(__file__), '../resources/trucks.zip'), 'rb') as trucks,
open(join(dirname(__file__), '../resources/cars.zip'), 'rb') as cars:
print(json.dumps(visual_recognition.create_classifier('CarsvsTrucks', trucks_positive_examples
18. Node.js
var watson = require('watson-developer-cloud');
var fs = require('fs');
var visual_recognition = watson.visual_recognition({
api_key: '{api_key}',
version: 'v3',
version_date: '2016-05-20'
});
var params = {
name: 'fruit',
apple_positive_examples: fs.createReadStream('./apples.zip'),
banana_positive_examples: fs.createReadStream('./yellow.zip'),
orange_positive_examples: fs.createReadStream('./pos_ex.zip'),
negative_examples: fs.createReadStream('./vegetables.zip')
};
visual_recognition.createClassifier(params,
function(err, response) {
if (err)
console.log(err);
else
console.log(JSON.stringify(response, null, 2));
});
44. m.com/blogs/bluemix/2016/10/watson-visual-recognition-training-
アプリの方向性を決める前に気をつけること
Examples of difficult use cases
While Watson Visual Recognition is highly flexible, there have been a number of recurring use case that we’ve seen the API either
struggle on or require significant pre/post-work from the user.
Face Recognition: Visual Recognition is capable of face detection (detecting the presence of faces) not face recognition
(identifying individuals).
Detecting details: Occasionally, users want to classify an image based on a small section of an image or details scattered
within an image. Because Watson analyzes the entire image when training, it may struggle on classifications that depend on
small details. Some users have adopted the strategy of breaking the image into pieces or zooming into relevant parts of an
image. See this hail classification use case as an example (video).
Emotion: Emotion classification (whether facial emotion or contextual emotion) is not a feature currently supported by Visual
Recognition. Some users have attempted to do this through custom classifiers, but this is an edge case and we cannot
estimate the accuracy of this type of training.
顔認識については、VisualRecogniotionは、
<人間の顔>を認識するには向いているが、
<個人の識別>をするのには向いていない