Skip to content

Instantly share code, notes, and snippets.

class DepthFirstSearch
def initialize(root)
@root = root
end
def find_by(value)
@value = value
find_from_node(root)
end
@ta-chibana
ta-chibana / cloud_vision_text.rb
Created January 16, 2018 15:41
Request to google cloud vision API and extract text from image.
require 'google/cloud/vision'
project_id = 'project_id'
vision = Google::Cloud::Vision.new(project: project_id,
keyfile: './service_account.json')
image = vision.image('./image.jpg')
puts image.text