我有一个带有图像URL列表的Google表格。
[第一列:图片网址。第二列:描述图像的标签(例如:“景观,山,田野,日落,湖泊”,用于包含山,田野,日落等的风景图像)
我想用“ ImageTags(ImageUrl)”之类的公式自动填充第2列。
是否有任何公式,扩展名或脚本(已经可用:))?
谢谢!
选项是使用Google Cloud Vision API标记图像。您可以测试API以确定它是否适合您的需求here。
有两个使用Google Apps脚本来调用API的教程,可以帮助您开发所需的确切代码:
作为示例,使用以下图像:
并使用以下参数调用API:
POST https://vision.googleapis.com/v1/images:annotate
{
"requests": [
{
"image": {
"source": {
"imageUri": "https://i.stack.imgur.com/4vwKt.jpg"
}
},
"features": [
{
"type": "LABEL_DETECTION"
}
]
}
]
}
您获得以下结果(2019年11月5日):
{
"responses": [
{
"labelAnnotations": [
{
"mid": "/m/09j06",
"description": "Hot air balloon",
"score": 0.9889263,
"topicality": 0.9889263
},
{
"mid": "/m/01j51",
"description": "Balloon",
"score": 0.95322704,
"topicality": 0.95322704
},
{
"mid": "/m/02p81ht",
"description": "Hot air ballooning",
"score": 0.9223063,
"topicality": 0.9223063
},
{
"mid": "/m/0cmqr_4",
"description": "Party supply",
"score": 0.9016293,
"topicality": 0.9016293
},
{
"mid": "/m/01d40f",
"description": "Dress",
"score": 0.86037284,
"topicality": 0.86037284
},
{
"mid": "/m/07yv9",
"description": "Vehicle",
"score": 0.7725018,
"topicality": 0.7725018
},
{
"mid": "/m/01bqvp",
"description": "Sky",
"score": 0.7326111,
"topicality": 0.7326111
},
{
"mid": "/m/0ds99lh",
"description": "Fun",
"score": 0.7039424,
"topicality": 0.7039424
},
{
"mid": "/m/016pp7",
"description": "Happy",
"score": 0.6789371,
"topicality": 0.6789371
},
{
"mid": "/m/06bm2",
"description": "Recreation",
"score": 0.6695586,
"topicality": 0.6695586
}
]
}
]
}