[RUBY] [Rails] v1.0 came out on google-cloud-vision of gem, so I tried to support it

I had to rewrite the code in Article I wrote before, so I tried to deal with it.

Be careful if you update gem google-cloud-vision from v0.x series to v1.0.0.

fundamentally

Migrating to google-cloud-vision 1.0 https://github.com/googleapis/google-cloud-ruby/blob/master/google-cloud-vision/MIGRATING.md

As it is written in, about #safe_search_detection [here](https://googleapis.dev/ruby/google-cloud-vision-v1/latest/Google/Cloud/Vision/V1/ImageAnnotator/Client. html # safe_search_detection-instance_method) was easier to understand.

    require "google/cloud/vision"
    image_annotator = Google::Cloud::Vision::ImageAnnotator.new

To

    require "google/cloud/vision/v1"
    image_annotator = Google::Cloud::Vision::V1::ImageAnnotator::Client.new

Rewritten to.

It seems that Google Cloud Vision had a destructive version upgrade before ...

Recommended Posts

[Rails] v1.0 came out on google-cloud-vision of gem, so I tried to support it
I tried to rescue the data of the laptop by booting it on Ubuntu
I didn't understand the Resize of TensorFlow so I tried to summarize it visually.
I tried to make it easy to change the setting of authenticated Proxy on Jupyter
I tried to create an environment of MkDocs on Amazon Linux
I tried to make a calculator with Tkinter so I will write it
Matching karaoke keys ~ I tried to put it on Laravel ~ <on the way>
I tried to install Docker on Windows 10 Home but it didn't work
The tree.plot_tree of scikit-learn was very easy and convenient, so I tried to summarize how to use it easily.
In IPython, when I tried to see the value, it was a generator, so I came up with it when I was frustrated.
I wanted to know the number of lines in multiple files, so I tried to get it with a command
I tried to publish my own module so that I can pip install it
A record of the time it took to deploy mysql on Cloud9 + Rails
I made an image classification model and tried to move it on mobile
I tried object detection with YOLO v3 (TensorFlow 2.1) on the GPU of windows!
[I'm an IT beginner] I tried my best to implement Linux on Windows
I tried to use Twitter Scraper on AWS Lambda and it didn't work.
I tried to display the infection condition of coronavirus on the heat map of seaborn
(complex) It depends on how to name the coefficient of the morlet wavelet, the appropriate setting value, and the material, so I tried to organize it as much as possible.
I tried to notify slack of Redmine update
I tried to find 100 million digits of pi
I tried running YOLO v3 on Google Colab
I tried to touch the API of ebay
I tried to correct the keystone of the image
I tried to predict the price of ETF
I tried to vectorize the lyrics of Hinatazaka46!
I tried to put out the frequent word ranking of LINE talk with Python
I want to collect a lot of images, so I tried using "google image download"
AWS CLI v2 has become GA (General Availability), so I tried using it immediately.
AtCoder Beginner Contest 177 Problem C I tried to find out why it was wrong
A Python beginner made a chat bot, so I tried to summarize how to make it.
I wanted to operate google spread sheet with AWS lambda, so I tried it [Part 2]
It is difficult to install a green screen, so I cut out only the face and superimposed it on the background image
It's getting cold, so I tried to make it possible to turn on / off the AC heater automatically with Raspberry Pi!
I tried to extract features with SIFT of OpenCV
I tried to summarize the basic form of GPLVM
I tried to implement Minesweeper on terminal with python
I tried to visualize the spacha information of VTuber
I tried to erase the negative part of Meros
AWS Lambda now supports Python so I tried it
[Python] I tried to get Json of squid ring 2
I tried to notify the honeypot report on LINE
I tried to implement automatic proof of sequence calculation
I tried to install scrapy on Anaconda and couldn't
I tried to classify the voices of voice actors
I tried to summarize the string operations of Python
When I tried to build a Rails environment on WSL2 (Ubuntu 20.04LTS), I stumbled and fell.
I made a function to crop the image of python openCV, so please use it.
I tried to predict the genre of music from the song title on the Recurrent Neural Network
I tried to sort out the objects from the image of the steak set meal-① Object detection
There was a doppelganger, so I tried to distinguish it with artificial intelligence (laughs) (Part 1)