我注意到返回标签或web检测,限制为5个标签/URL。参见background.js文件中的Google云视觉Chrome扩展
我怎么能提高限额呢?
我尝试过添加max_result: 100或limit:100,但没有起作用。
var detect = function(type, b64data, cb) {
var url = 'https://vision.googleapis.com/v1/images:annotate?key='+API_KEY;
var data = {
requests: [{
image: {content: b64data},
features: [{'type':type}],
max_result: 100
}]
}
http('POST', url, JSON.stringify(data), cb);
};发布于 2017-07-27 05:31:03
{
"image": {
object(Image)
},
"features": [
{
object(Feature)
}
],
"imageContext": {
object(ImageContext)
},
}如果要更改结果的最大数量,则在features 数组中的对象中。
{
"type": enum(Type),
"maxResults": number,
}正如你所看到的,它是maxResults。此外,您在错误的对象中添加了它。
您的requests应该是:
var data = {
requests: [{
image: {content: b64data},
features: [{
type: type,
maxResults: 100
}]
}]
};但是,API文档没有指定提供的默认结果为5个。因此,API可能已经返回了五个以上的结果。如果是这样的话,您将需要在云视觉扩展的其他地方查找实际限制为5个结果的内容。
https://stackoverflow.com/questions/45341208
复制相似问题