【问题标题】:Implement latest Google Cloud Vision Api Text/Logo Recognition update - LabelDetectionConfig - from Sept 28, 2018?从 2018 年 9 月 28 日起实施最新的 Google Cloud Vision Api 文本/徽标识别更新 - LabelDetectionConfig?
【发布时间】:2018-10-31 10:38:50
【问题描述】:

有人知道如何在 Google Cloud Vision api for PHP 中设置 LabelDetectionConfig 吗?

显然有新功能发布,描述如下:https://cloud.google.com/vision/docs/release-notes

改进的检测模型现在可用于以下功能:

标志检测 文本检测 (OCR) 在 LabelDetectionConfig 字段中指定“builtin/latest”以使用新模型。

在接下来的 90 天内,我们将同时支持当前型号和新型号。 90 天后,当前的检测模型将被弃用,只有新的检测模型将用于所有徽标和文本 (OCR) 检测请求。

这就是我的代码现在的样子:

$vision = new VisionClient([
   'projectId' => XXXX
]);
$contents = get_contents($url);
$image = $vision->image($contents, ['LOGO_DETECTION']);
$result = $vision->annotate($image);

【问题讨论】:

  • 找到答案了吗?

标签: php google-api google-cloud-platform google-vision


【解决方案1】:

根据this documentation,此参数设置在“功能”对象的“模型”字段中,而不是如Vision API release notes (LabelDetectionConfig) 中所示。看看我假设您正在使用的PHP client,它允许您设置一个“$features”数组,因此,您可以使用“model”参数和“builtin/latest”值来设置这个数组。

【讨论】:

  • 看起来是正确的文档,谢谢。我会尽快发布一个确切的解决方案。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-04-22
  • 1970-01-01
  • 2019-02-28
  • 2021-04-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多