我试图使用Alloy Appcelerator的Google vision API v1
我创建了一个请求HTTPClient并调用API https://vision.googleapis.com/v1/images:annotate?key=MY_APP_KEY
但我得到谷歌的响应文本:
{
error = {
code = 400;
details = (
{
"@type" = "type.googleapis.com/google.rpc.BadRequest";
fieldViolations = ({
description = "Invalid JSON payload received. Unknown name \"request\": Cannot bind query parameter. Field 'request' could not be found in request message.";
});
}
);
message = "Invalid JSON payload received. Unknown name \"request\": Cannot bind query parameter. Field 'request' could not be found in request message.";
status = "INVALID_ARGUMENT";
};
Run Code Online (Sandbox Code Playgroud)
}
我的代码使用Alloy的HTTP请求
var requests …Run Code Online (Sandbox Code Playgroud) 我正在尝试制作一款Android应用,当它检测到一张脸时会拍一张照片.我试图关注Google的Mobile Vision FaceDetector Pipeline,但我无法过去
FaceDetector faceDetector = new FaceDetector.Builder().build(getApplicationContext());
Run Code Online (Sandbox Code Playgroud)
Builder是鲜红色,说不能解决符号Builder.
我已经检查了我的Gradle文件和我的Android Manifest,它们与Google的相同.
我无法弄清楚接下来该做什么.
另外,如果有人能指出我在FaceDetection上使用Camera2 API的好教程,我真的很感激.
我正在使用Google Vision Api,并且我知道如何使用下面的任何图像uri发送请求。
`{
"requests":[
{
"image":{
"source":{
"imageUri":
"https://fallaviblob.blob.core.windows.net/createdblobs/20170601_191635_237.png"
}
},
"features":[
{
"type":"LABEL_DETECTION"
},
{
"type":"WEB_DETECTION"
}
]
}
]
}`
Run Code Online (Sandbox Code Playgroud)
我想通过Php客户端库使用发送请求。当我查看Google Vision文档上的示例代码时,它仅显示适用于Google Cloud Storage的远程映像的本地映像的示例。
https://cloud.google.com/vision/docs/detecting-labels#vision-label-detection-gcs-php
如您所见,我需要使用带有远程URL的Php客户端库,但是我不能。
谢谢。
我在向部署在 Google Cloud Kubernetes 集群中的 Spring Boot 应用程序发送请求时遇到困难。我的应用程序接收一张照片并将其发送到 Google Vision API。我正在使用提供的客户端库(https://cloud.google.com/vision/docs/libraries#client-libraries-install-java),如此处所述https://cloud.google.com/vision/docs/auth:
如果您使用客户端库调用 Vision API,请使用应用程序默认凭据 (ADC)。使用 ADC 的服务在 GOOGLE_APPLICATION_CREDENTIALS 环境变量中查找凭据。除非您特别希望让 ADC 使用其他凭据(例如用户凭据),否则我们建议您设置此环境变量以指向您的服务帐户密钥文件。
在我的本地机器上一切正常,我有一个带有环境的 docker 容器。varialbe GOOGLE_APPLICATION_CREDENTIALS 指向我的服务帐户密钥文件。
我的集群中没有这个变量。这是我从 Kubernetes 集群中的应用程序得到的响应:
{
"timestamp": "2018-05-10T14:07:27.652+0000",
"status": 500,
"error": "Internal Server Error",
"message": "io.grpc.StatusRuntimeException: PERMISSION_DENIED: Request had insufficient authentication scopes.",
"path": "/image"
}
Run Code Online (Sandbox Code Playgroud)
我做错了什么?提前谢谢!
我正在使用ArSceneView ArFrame获取相机图像
arFragment.getArSceneView().getArFrame().acquireCameraImage()"
Run Code Online (Sandbox Code Playgroud)
这将返回android.media图像模型。我正在尝试将此图像转换为:
com.google.api.services.vision.v1.model.Image
Run Code Online (Sandbox Code Playgroud)
我可以告诉我做到这一点的唯一方法是将android.media Image转换为btye [],然后使用byte []创建视觉图像模型。我的问题是我不知道如何转换android.media图像。
在此页面https://cloud.google.com/docs/authentication/production 上,有一个指南,其中包含有关如何设置 google API 身份验证的示例。但是,我的 IDE 似乎无法理解或无法找到验证所需的“ToChannelCredentials()”方法。有什么特定的东西我没有导入吗?这是我的代码
using System;
using System.IO;
using Grpc.Core;
using Google.Apis.Auth.OAuth2;
using Google.Cloud.Vision.V1;
namespace ClassLibrary1
{
public class Class1
{
public static void Main(String[] args)
{
var credential = GoogleCredential.FromFile("myPath").CreateScoped(ImageAnnotatorClient.DefaultScopes);
var channel = new Grpc.Core.Channel(ImageAnnotatorClient.DefaultEndpoint.ToString(), credential.;
var client = ImageAnnotatorClient.Create();
var image = Image.FromFile("myImage");
var response = client.DetectLabels(image);
foreach (var annotation in response)
{
if (annotation.Description != null)
{
Console.WriteLine(annotation.Description);
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud) 我正在使用 Google ML Kit 进行自拍分割(https://developers.google.com/ml-kit/vision/selfie-segmentation)。然而,我得到的输出非常差 -
初始图像:
带叠加的分割图像:观察该女性的头发如何标记为粉红色,以及健身器材和她腿部附近的周围区域如何标记为非粉红色。甚至她的手也被标记为粉红色(意味着它是背景)。
当它叠加在另一张图像上以创建背景去除效果时,看起来很糟糕
ML Kit 返回的分割掩模对于上述所有非粉色区域的置信度均为 1.0,这意味着绝对可以肯定非粉色区域是人的一部分!
我在几张图片中看到了这一点,而不仅仅是这张图片。事实上,图像分割器的性能(置信度)相当差。
问题是 - 有没有办法改进它,也许通过提供不同/更好的模型?如果我使用 PixelLib 之类的东西,分割效果会更好,尽管该库的性能延迟不低,因此无法在移动设备上运行。
任何有关此的指示/帮助将不胜感激。
image-processing image-segmentation google-vision google-mlkit