LoginSignup
2
0

OCI VisionのFace detectionを触ってみた

Last updated at Posted at 2023-11-15

初めてのqiita記事です。
まずは投稿することを目的に記載してみたので、内容が触ってみた系ですが、今後は検証など投稿していけたらなと思ってます。

はじめに

OCIが提供しているAIサービスの全体像について確認したいと思います。

https://speakerdeck.com/oracle4engineer/vision-overview?slide=3 より
image.png

OCIが提供するAIサービスの中でオブジェクト検出、イメージ分類など画像を扱うサービスがVisionになります。
(↑のスクショだと、虫眼鏡がアイコンになっているサービスですね)
今回はvisionの一部の機能であるFace detectionが公開された為、触ってみました。

まずはFace detectionを開く

[アナリティクスとAI] > [AIサービス] > [ビジョン]で、Face detectionページまでたどります。
Face detectionでは以下のスクリーンショットのように、5人の画像がテスト的に表示されてます。
image.png

Face detectionで何を検出してくれるか

表示されている画像をよく見ると、顔が白い線で囲われてたり、目や鼻に白い点があり、既に何か識別されてます。
ちなみに具体的に何を判定してくれてるかは以下になります。

  • 境界ボックス座標を使用した各画像内の顔の位置
  • 左目、右目、鼻先、口の左右の端

結果について

画面の右側にFace1~Face5のラベルとその信頼度がパーセンテージで記載されてます。

image.png

また本サービスはJSON形式で結果が返ってくるので、そちらも確認してみましょう
今回レスポンスは5人分の結果で、量が多い為、全量は下記に折りたたんで置いておきます。

レスポンス
{
  "ontologyClasses": [],
  "detectedFaces": [
    {
      "confidence": 0.9838427,
      "boundingPolygon": {
        "normalizedVertices": [
          {
            "x": 0.48696465492248536,
            "y": 0.2889890061576746
          },
          {
            "x": 0.6339863777160645,
            "y": 0.2889890061576746
          },
          {
            "x": 0.6339863777160645,
            "y": 0.586297366400352
          },
          {
            "x": 0.48696465492248536,
            "y": 0.586297366400352
          }
        ]
      },
      "qualityScore": 0.9043028,
      "landmarks": [
        {
          "type": "LEFT_EYE",
          "x": 0.5203125,
          "y": 0.41114983
        },
        {
          "type": "RIGHT_EYE",
          "x": 0.590625,
          "y": 0.41231126
        },
        {
          "type": "NOSE_TIP",
          "x": 0.553125,
          "y": 0.4715447
        },
        {
          "type": "LEFT_EDGE_OF_MOUTH",
          "x": 0.5210937,
          "y": 0.5005807
        },
        {
          "type": "RIGHT_EDGE_OF_MOUTH",
          "x": 0.5914062,
          "y": 0.5017422
        }
      ]
    },
    {
      "confidence": 0.9775677,
      "boundingPolygon": {
        "normalizedVertices": [
          {
            "x": 0.7882407665252685,
            "y": 0.26365977075734065
          },
          {
            "x": 0.9403343200683594,
            "y": 0.26365977075734065
          },
          {
            "x": 0.9403343200683594,
            "y": 0.5528718281567582
          },
          {
            "x": 0.7882407665252685,
            "y": 0.5528718281567582
          }
        ]
      },
      "qualityScore": 0.786416,
      "landmarks": [
        {
          "type": "LEFT_EYE",
          "x": 0.81328124,
          "y": 0.37514517
        },
        {
          "type": "RIGHT_EYE",
          "x": 0.88125,
          "y": 0.39140534
        },
        {
          "type": "NOSE_TIP",
          "x": 0.8296875,
          "y": 0.44134727
        },
        {
          "type": "LEFT_EDGE_OF_MOUTH",
          "x": 0.8078125,
          "y": 0.46689895
        },
        {
          "type": "RIGHT_EDGE_OF_MOUTH",
          "x": 0.8726562,
          "y": 0.48083624
        }
      ]
    },
    {
      "confidence": 0.97464997,
      "boundingPolygon": {
        "normalizedVertices": [
          {
            "x": 0.038544440269470216,
            "y": 0.2764744597998784
          },
          {
            "x": 0.17794162034988403,
            "y": 0.2764744597998784
          },
          {
            "x": 0.17794162034988403,
            "y": 0.560027438173726
          },
          {
            "x": 0.038544440269470216,
            "y": 0.560027438173726
          }
        ]
      },
      "qualityScore": 0.8527186,
      "landmarks": [
        {
          "type": "LEFT_EYE",
          "x": 0.08984375,
          "y": 0.3809524
        },
        {
          "type": "RIGHT_EYE",
          "x": 0.15234375,
          "y": 0.39140534
        },
        {
          "type": "NOSE_TIP",
          "x": 0.12421875,
          "y": 0.44599304
        },
        {
          "type": "LEFT_EDGE_OF_MOUTH",
          "x": 0.07734375,
          "y": 0.46689895
        },
        {
          "type": "RIGHT_EDGE_OF_MOUTH",
          "x": 0.14375,
          "y": 0.47619048
        }
      ]
    },
    {
      "confidence": 0.96874785,
      "boundingPolygon": {
        "normalizedVertices": [
          {
            "x": 0.2698225736618042,
            "y": 0.24420403492713777
          },
          {
            "x": 0.38425185680389407,
            "y": 0.24420403492713777
          },
          {
            "x": 0.38425185680389407,
            "y": 0.4686152760575457
          },
          {
            "x": 0.2698225736618042,
            "y": 0.4686152760575457
          }
        ]
      },
      "qualityScore": 0.8934359,
      "landmarks": [
        {
          "type": "LEFT_EYE",
          "x": 0.29453126,
          "y": 0.3240418
        },
        {
          "type": "RIGHT_EYE",
          "x": 0.3484375,
          "y": 0.33681765
        },
        {
          "type": "NOSE_TIP",
          "x": 0.31328124,
          "y": 0.3821138
        },
        {
          "type": "LEFT_EDGE_OF_MOUTH",
          "x": 0.2890625,
          "y": 0.39372823
        },
        {
          "type": "RIGHT_EDGE_OF_MOUTH",
          "x": 0.3453125,
          "y": 0.40301976
        }
      ]
    },
    {
      "confidence": 0.95825064,
      "boundingPolygon": {
        "normalizedVertices": [
          {
            "x": 0.6876011371612549,
            "y": 0.10002164585942037
          },
          {
            "x": 0.8045546531677246,
            "y": 0.10002164585942037
          },
          {
            "x": 0.8045546531677246,
            "y": 0.3600864033804261
          },
          {
            "x": 0.6876011371612549,
            "y": 0.3600864033804261
          }
        ]
      },
      "qualityScore": 0.9237982,
      "landmarks": [
        {
          "type": "LEFT_EYE",
          "x": 0.7171875,
          "y": 0.19976771
        },
        {
          "type": "RIGHT_EYE",
          "x": 0.7703125,
          "y": 0.21254355
        },
        {
          "type": "NOSE_TIP",
          "x": 0.7367188,
          "y": 0.2601626
        },
        {
          "type": "LEFT_EDGE_OF_MOUTH",
          "x": 0.7085937,
          "y": 0.2752613
        },
        {
          "type": "RIGHT_EDGE_OF_MOUTH",
          "x": 0.76640624,
          "y": 0.2857143
        }
      ]
    }
  ],
  "faceDetectionModelVersion": "1.0.29",
  "errors": []
}

1人分だけちゃんと確認していきたいと思います。

confidence:信頼度。結果に表示される信頼度になります。
boundingPolygon:境界ボックス座標を使用した各画像内の顔の位置。それぞれのx軸とy軸の座標が取得されてます。
qualityScore:品質スコア。この数値が高いほど生体認証に適しています。
landmarks:ランドマーク(右目、左目、鼻の中心、口の右端と左端)の位置。それぞれのx軸とy軸の座標が取得されてます。

 {
      "confidence": 0.9838427,
      "boundingPolygon": {
        "normalizedVertices": [
          {
            "x": 0.48696465492248536,
            "y": 0.2889890061576746
          },
          {
            "x": 0.6339863777160645,
            "y": 0.2889890061576746
          },
          {
            "x": 0.6339863777160645,
            "y": 0.586297366400352
          },
          {
            "x": 0.48696465492248536,
            "y": 0.586297366400352
          }
        ]
      },


      "qualityScore": 0.9043028,
      "landmarks": [
        {
          "type": "LEFT_EYE",
          "x": 0.5203125,
          "y": 0.41114983
        },
        {
          "type": "RIGHT_EYE",
          "x": 0.590625,
          "y": 0.41231126
        },
        {
          "type": "NOSE_TIP",
          "x": 0.553125,
          "y": 0.4715447
        },
        {
          "type": "LEFT_EDGE_OF_MOUTH",
          "x": 0.5210937,
          "y": 0.5005807
        },
        {
          "type": "RIGHT_EDGE_OF_MOUTH",
          "x": 0.5914062,
          "y": 0.5017422
        }
      ]
    },

何に活用できるか

OCI Vision face detection now available
こちらの記事によると、以下のように記載があります。

・Privacy: Hide identities by adding a blur to the image using face location information returned through the face detection feature.
・Prerequisite for Biometrics: Use the facial quality score to determine if a face is clear and unobstructed.
・Digital asset management: Tag images with facial information for better indexing and retrieval.

個人的な見解ですが、
検出した顔に固有の識別子を付けるわけではないため、顔認証や識別というよりは顔の検出に特化したもので、これからのアップデートに期待という印象です。

読んでいただきありがとうございます。

参考先

OCI Vision face detection now available
Oracle Cloud Infrastructure 新機能ハイライト - 2023/10/18

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