Google vision 在Google Vision API中传递多个图像以获得注释

Google vision 在Google Vision API中传递多个图像以获得注释,google-vision,Google Vision,如何传递包含要在Google Vision API中传递的绘画的种子数据。我正在使用rails后端。基本上,我不是只传递一个图像,而是尝试传递所有图像以进行分析 #Imports the Google Cloud client library require "google/cloud/vision" require 'net/http' # Instantiates a client class Trial::Painting image_annotator = Googl

如何传递包含要在Google Vision API中传递的绘画的种子数据。我正在使用rails后端。基本上,我不是只传递一个图像,而是尝试传递所有图像以进行分析

#Imports the Google Cloud client library
require "google/cloud/vision"
require 'net/http'
# Instantiates a client
class Trial::Painting
image_annotator = Google::Cloud::Vision.image_annotator

# The name of the image file to annotate
file_name ="https://artlogic-res.cloudinary.com/w_1600,h_1600,c_limit,f_auto,fl_lossy,q_auto/artlogicstorage/addisfineart/images/view/709288e5cbace40177a4321493a94b56/addisfineart-girma-berta-asmara-x-2018.jpg"

# Performs label detection on the image file
response = image_annotator.label_detection image: Painting.all
response.responses.each do |res|
  puts "Labels:"
  res.label_annotations.each do |label|
    puts label.description
  end
end
trial = Trial.new
end