CLOVA GreenEye Custom API
- 印刷する
- PDF
CLOVA GreenEye Custom API
- 印刷する
- PDF
記事の要約
この要約は役に立ちましたか?
ご意見ありがとうございます
version
Version | Date | Changes |
---|---|---|
v1.0.0 | 2022-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-Type | application/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 説明 version string Y V1 requestId string Y API呼び出し UUID timestamp number Y API呼び出し Timestamp値 images json array Y JSON arrayで、現在は1つの画像のみ入力可能 images[].name string Y 画像名入力。画像識別およびレスポンス結果確認の際に使用 images[].url string N images.urlまたは images.dataのどちらか1つは必要。
URLは画像が読み込める公開 URLのみimages[].data string N images.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 説明 name string Y リクエストした画像名 message string Y 画像認識成功時には「SUCCESS」
画像認識失敗時のエラーメッセージ表示result json object Y result.adult json object Y result.adult.confidence float Y 「成人」画像スコア(0~1点) result.normal json object Y result.normal.confidence float Y 「一般」画像スコア(0~1点) result.porn json object Y result.porn.confidence float Y 「淫乱」画像スコア(0~1点) result.sexy json object Y result.sexy.confidence float Y 「わいせつ」画像スコア(0~1点) latency int Y レスポンス時間(ミリ秒) confidence float Y
例
リクエスト例
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"}]}'
この記事は役に立ちましたか?