小编Joh*_*ink的帖子

Google Vision Batch使用Java客户端库批注图像

尝试使用提供的Java客户端谷歌愿景通过Google Vision注释图像时,我遇到了异常.

特别是批量client.batchAnnotateImages发生的代码:

public void processOCR(byte[] file) 
{
     List<AnnotateImageRequest> requests = new ArrayList<>();

      ByteString imageByteString = ByteString.copyFrom(file);

      Image img = Image.newBuilder().setContent(imageByteString).build();
      Feature feat = Feature.newBuilder().setType(Type.DOCUMENT_TEXT_DETECTION).build();

      AnnotateImageRequest request = AnnotateImageRequest.newBuilder().addFeatures(feat).setImage(img).build();
      requests.add(request);

      try (ImageAnnotatorClient client = ImageAnnotatorClient.create()) 
      {

        BatchAnnotateImagesResponse response = client.batchAnnotateImages(requests);
        List<AnnotateImageResponse> responses = response.getResponsesList();
        client.close();

        //visionResultsDTO result = new visionResultsDTO();
        String ParagraphText = "";


        for (AnnotateImageResponse res : responses) {
          if (res.hasError()) {
            //throw exception.
            return;
          }

          // For full list of available annotations, see http://g.co/cloud/vision/docs
          TextAnnotation annotation = res.getFullTextAnnotation(); …
Run Code Online (Sandbox Code Playgroud)

java maven spring-boot google-vision

8
推荐指数
1
解决办法
678
查看次数

以编程方式部署 Azure Web 应用程序

有没有一种方法/API可以以编程方式将Azure应用程序服务(特别是Web应用程序)部署到Azure?

或使用不同的域名创建站点的多个实例?

基本思想是将用户可配置/可主题化的网站作为产品向公众出售,并在客户购买应用程序后自动执行 Azure 部署?

azure azure-web-app-service

4
推荐指数
1
解决办法
2302
查看次数