LoginSignup
1
2

More than 5 years have passed since last update.

デコレーション料理や食品サンプルでVision APIを試してみる

Last updated at Posted at 2016-03-16

単純に気になったからやってみました。
Vision APIに関しては別途調べてください

カレーの場合

これをデコレーション料理と呼ぶのかどうかわかりませんが…

Auto Generated Inline Image 2.jpeg

かわいい熊っぽく見えますが、カレーライスです。

{
      "labelAnnotations": [
        {
          "mid": "/m/02wbm",
          "description": "food",
          "score": 0.97492784
        },
        {
          "mid": "/m/02q08p0",
          "description": "dish",
          "score": 0.94399673
        },
        {
          "mid": "/m/05nmk4",
          "description": "laddu",
          "score": 0.74797714
        },
        {
          "mid": "/m/0krfg",
          "description": "meal",
          "score": 0.71717829
        },
        {
          "mid": "/m/0270h",
          "description": "dessert",
          "score": 0.68745786
        },
        {
          "mid": "/m/012xxq",
          "description": "onigiri",
          "score": 0.64166111
        },
        {
          "mid": "/m/03myzy",
          "description": "upma",
          "score": 0.58522344
        },
        {
          "mid": "/m/07xgrh",
          "description": "ingredient",
          "score": 0.56503797
        },
        {
          "mid": "/m/0f4s2w",
          "description": "vegetable",
          "score": 0.52960825
        }
      ],
      "textAnnotations": [
        {
          "locale": "zh",
          "description": "碎atti\n",
          "boundingPoly": {
            "vertices": [
              {
                "x": 212,
                "y": 204
              },
              {
                "x": 255,
                "y": 204
              },
              {
                "x": 255,
                "y": 222
              },
              {
                "x": 212,
                "y": 222
              }
            ]
          }
        }
      ],
      "safeSearchAnnotation": {
        "adult": "VERY_UNLIKELY",
        "spoof": "VERY_UNLIKELY",
        "medical": "VERY_UNLIKELY",
        "violence": "VERY_UNLIKELY"
      }
    }

food, dish, laddu, meal, dessert, onigiri, upma, ingredient, vegetable と認識されていますね。
また、おそらく鼻のあたりが文字としても認識されています。
ちなみに、顔としては認識されませんでした。
Vision APIは騙されませんでしたね。

食品サンプルの場合

Auto Generated Inline Image 1.jpeg

    {
      "labelAnnotations": [
        {
          "mid": "/m/02wbm",
          "description": "food",
          "score": 0.93824375
        },
        {
          "mid": "/m/02q08p0",
          "description": "dish",
          "score": 0.92923653
        },
        {
          "mid": "/m/0416b0",
          "description": "bolognese sauce",
          "score": 0.89884353
        },
        {
          "mid": "/m/0772h",
          "description": "spaghetti",
          "score": 0.88926464
        },
        {
          "mid": "/m/078dnm",
          "description": "bucatini",
          "score": 0.777858
        },
        {
          "mid": "/m/0c9ph5",
          "description": "flower",
          "score": 0.71507853
        },
        {
          "mid": "/m/02x7pff",
          "description": "pici",
          "score": 0.7139492
        },
        {
          "mid": "/m/0f4s2w",
          "description": "vegetable",
          "score": 0.63393778
        },
        {
          "mid": "/m/02s3cz",
          "description": "scampi",
          "score": 0.62521577
        },
        {
          "mid": "/m/06nwz",
          "description": "seafood",
          "score": 0.58160788
        }
      ],
      "safeSearchAnnotation": {
        "adult": "VERY_UNLIKELY",
        "spoof": "VERY_UNLIKELY",
        "medical": "UNLIKELY",
        "violence": "VERY_UNLIKELY"
      }
    }

food, dish, bolognese sause, spaghetti, bucatini, flower, pici, vegetable, scampi, seafood
などと認識されています。
こちらは見事に騙されていますね。
浮いているフォークを検出できたら、もしかして…?

ちなみに、このスパゲッティはおそらくナポリタンだと思うのですが、ナポリタンは日本独自の料理らしいですよ。

まとめ

ただ単に気になったので、一体どのように認識されるかが見たかったのですが、コンテキストが絡むような画像解析を行う場合は考慮する必要がありそうです。
といっても、やっぱりVision APIはすごいですね。

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