LoginSignup
0
1

More than 3 years have passed since last update.

【Rails】gemのgoogle-cloud-visionでv1.0が出たので対応してみた

Posted at

以前に書いた記事でコードを書き換える必要があったので対応してみました。

gem google-cloud-visionをv0.x系からv1.0.0にアップデートしたら要注意です。

基本的に

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

に書いてあるとおりなのですが#safe_search_detectionについてはこちらのほうがわかりやすかったです。

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

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

に書き換えました。

Google Cloud Visionについては以前にも破壊的なバージョンアップがあったような...

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1