16
16

More than 5 years have passed since last update.

docomo 画像認識 API の Python ラッパーライブラリを作りました。

Posted at

リポジトリ

使い方

例えば、玉葱さん太郎の画像を使ってこのようにリクエストを送ってみる。

import docomocv as d

client = d.DocomoCVClient(<YOUR_API_KEY>)
client.recognize('./tamanegi.jpg', d.Recog.food)

このような結果が得られる。

{'candidates': [{'sites': [{'imageUrl': 'http://ecx.images-amazon.com/images/I/61t%2BbGIlK2L._SX385_.jpg', 'url': 'http://www.amazon.co.jp/gp/product/B0094BL1RM', 'title': 'Amazon.co.jp: やおきん 玉葱さん太郎 15300袋: 食品&飲料'}], 'itemId': 'food_0000193194', 'imageUrl': 'http://ecx.images-amazon.com/images/I/61t%2BbGIlK2L._SX385_.jpg', 'category': 'food', 'score': 1728.025390625, 'detail': {'releaseDate': '2012/09/03', 'quantity': '300', 'itemName': 'やおきん 玉葱さん太郎 15300袋', 'maker': 'やおきん', 'brand': 'やおきん', 'weight': '8 Kg', 'dimension': '61.4 x 57 x 43.2 cm'}}], 'recognitionId': '61486d30-5e3d-11e4-84c4-065d0f977797'}
>

玉葱さん太郎として認識されていますね!

16
16
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
16
16