LoginSignup
3
2

More than 5 years have passed since last update.

Vision API quick start

Last updated at Posted at 2016-07-21

quickstartをやってみる。

前提として、Google Cloud Platformへの登録が必要。

手順

  • projectの設定
    • GCPでprojectを作る
    • 課金モードに切り替える($300ドル分のポイントと、60日のフリートライアルがついてくる)
    • 作ったprojectにVision APIの設定をする
  • Cloud Storageのbucketを作る
  • Cloud Vision APIにリクエストを投げる
    • 画像をダウンロードする
    • Cloud Platform Console Storage Browserを開き、画像をbucketにアップロードする
    • 画像にPublic linkをつけるように、Share publiclyの項目でチェックボックスにチェックを入れる
    • quick startのページにあるフォームのgcsImageUriにアップロードした画像のuriをいれる
      • gcsImageUriは、 gs://BUCKET_NAME/FILEPATH になる
      • urlを入力するとerror 3が返ってくる

'''

{
"responses": [
{
"labelAnnotations": [
{
"mid": "/m/068hy",
"description": "pet",
"score": 0.98414
},
{
"mid": "/m/0bt9lr",
"description": "dog",
"score": 0.97904623
},
{
"mid": "/m/04rky",
"description": "mammal",
"score": 0.96168429
},
{
"mid": "/m/0jbk",
"description": "animal",
"score": 0.95276582
},
{
"mid": "/m/09686",
"description": "vertebrate",
"score": 0.89599335
}
]
}
]
}
'''

3
2
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
3
2