CLOVA GreenEye Custom API
    • PDF

    CLOVA GreenEye Custom API

    • PDF

    記事の要約

    version

    VersionDateChanges
    v1.0.02022-12-15最初の作成

    リクエストヘッダ

    CLOVA GreenEyeサービスでドメインを作成すると API連携設定 を通して Secret Keyおよび APIGW Invoke URLが確認できます。

    • ${Invoke URL}: Domain > API連携設定からコピーする
    • ${Secret Key}: Domain > API連携設定からコピーする
    ヘッダ名説明
    X-GREEN-EYE-SECRETドメインで API Gateway連携時に作成した X-GREEN-EYE-SECRET:{Client Secret}
    Content-Typeapplication/json : request use json body. Support images.url or images.data encoded with base64.

    リクエストボディ

    Content-Type : application/json

    • 認識リクエスト

      区分Json Model
      画像認識リクエスト{
      "version": "V1",,
      "requestId": "requestId",
      "timestamp": 1666321382401,
      "images": [{
      "name": "demo",
      "url": "https://kr.object.ncloudstorage.com/demo.jpg",
      "data": "base64"
      }]
      }
    • 認識リクエストフィールドに関する詳細説明

      フィールド名データタイプrequired説明
      versionstringYV1
      requestIdstringYAPI呼び出し UUID
      timestampnumberYAPI呼び出し Timestamp値
      imagesjson arrayYJSON arrayで、現在は1つの画像のみ入力可能
      images[].namestringY画像名入力。画像識別およびレスポンス結果確認の際に使用
      images[].urlstringNimages.urlまたは images.dataのどちらか1つは必要。
      URLは画像が読み込める公開 URLのみ
      images[].datastringNimages.urlまたは images.dataのどちらか1つは必要。URLとデータすべてが存在すればデータを使用し、URLは無視する
      images.dataは base64インコード画像バイト数

    レスポンス

    レスポンスボディ

    Request version is 'V1'

    • 認識結果

      区分Json Model
      認識結果{
      "version": "V1",
      "requestId": "requestId",
      "timestamp": 1666321382401,
      "images": [
      {
      "message": "SUCCESS",
      "name": "demo",
      "result": {
      "adult": {
      "confidence": 0.02559172734618187
      },
      "normal": {
      "confidence": 0.9171954393386841
      },
      "porn": {
      "confidence": 0.03023086115717888
      },
      "sexy": {
      "confidence": 0.02698194608092308
      }
      },
      "latency": 123.0,
      "confidence": 0.9171954393386841
      }
      ]
      }
    • 認識結果フィールドの詳細説明

      フィールド名データタイプalwaysExists説明
      namestringYリクエストした画像名
      messagestringY画像認識成功時には「SUCCESS」
      画像認識失敗時のエラーメッセージ表示
      resultjson objectY
      result.adultjson objectY
      result.adult.confidencefloatY「成人」画像スコア(0~1点)
      result.normaljson objectY
      result.normal.confidencefloatY「一般」画像スコア(0~1点)
      result.pornjson objectY
      result.porn.confidencefloatY「淫乱」画像スコア(0~1点)
      result.sexyjson objectY
      result.sexy.confidencefloatY「わいせつ」画像スコア(0~1点)
      latencyintYレスポンス時間(ミリ秒)
      confidencefloatY

    リクエスト例

    curl -X POST 'https://clovagreeneye.apigw.ntruss.com/custom/v1/{domainId}/{signature}/predict' -H 'X-GREEN-EYE-SECRET: {Client Secret}' -H 'Content-Type: application/json' -d '{"version":"V1","requestId":"xxx","timestamp":0,"images":[{"name":"demo","url":"https://kr.object.ncloudstorage.com/test/test.jpg"}]}'
    

    この記事は役に立ちましたか?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.