我创建了一个示例应用程序来测试来自 Google Cloud Vision API 的图像情感分析,但我没有得到好的结果。该应用在 App Engine 上运行:https ://feel-vision.appspot.com
悲伤、愤怒和惊讶的可能性真的很难从“非常不可能”的门槛上移开,无论我多么悲伤、愤怒或惊讶地试图看到照片。
快乐的可能性是通过假装微笑很容易移动的东西。
我可以做些什么来改善情绪分析结果吗?
目前我正在以这种方式调用 API(使用 Java 客户端):
//dataUrl is the JPEG base64 encoded image sent by the client
AnnotateImageRequest req = new AnnotateImageRequest()
.setImage(new Image().setContent(dataUrl))
.setFeatures(Arrays.asList(
new Feature().setType("LABEL_DETECTION"),
new Feature().setType("FACE_DETECTION")));
Annotate annotate = vision.images().annotate(new BatchAnnotateImagesRequest().setRequests(Arrays.asList(req)));
BatchAnnotateImagesResponse batchResponse = annotate.execute();
//process the response