Online Image Detection API
API Address
https://as.dun.163yun.com/v4/image/check
API Description
The API synchronously returns the real-time anti-spam detection result of the content security service, and the product can performs preliminary filtering according to the image classification result. Due to the influence of the network environment and the size of the picture itself (recommended to check after the product is compressed), some pictures may have a download timeout condition,and the part of the data will go to the offline detection module for offline processing of the machine until it is obtained result. After the offline detection, there may be some uncertain data that needs to be confirmed manually. Offline detection results and manual confirmation results require the product to periodically call offline image detection result acquisition.
Image Restrictions
Currently supported image file formats are: jpg, png, bmp, gif, webp, tiff;
Support picture size: single <10M;
Image size: not less than 50px*50px;
GIF/long image: Yidun will automatically detected by frame, up to 5, the billing is according to the actual number of frame;
Long image definition: aspect ratio is barger than 5;
Request Parameters
The public parameters have been omitted. See Public Request Parameters for details
Parameter Name | Type | Required | Maximum Length | Description |
---|---|---|---|---|
images | String(json array) | Y | 32 or 10MB | images for json arrays, support for batch detection |
account | String | N | 128 | User unique identifier, null if no login required |
ip | String | N | 32 | User IP Address |
version | String | Y | 4 | API version v4 |
Image parameter structure description
Field Name | Type | Required | Maximum Length | Description |
---|---|---|---|---|
name | String | Y | 1024 | Image name (or image identifier), this field is the callback signal field, the product can be designed according to the business situation, such as json structure, or picture url can be |
type | Number | Y | 4 | Type, respectively 1: Image URL, 2: Image BASE64 value |
data | String | Y | 32 or 10MB | Image content, the value is the image URL if as type=1, then the value is the picture BASE64 value if as type=2. Image URL detection supports up to 32 single requests, and image BASE64 value detection single request size is limited to a maximum of 10MB |
Response Result
The response field is as follows, the response common field has been omitted, see Response General Fields for details:
Anstispam Result
Antispam array data structure
Parameter Name | Type | Description |
---|---|---|
name | String | Image Name (or Image ID) |
taskId | String | This request data identifier, you can query the latest results of the data according to the identifier |
status | Number | Image detection status code, defined as: 0: successful detection, 610: image download failed, 620: image format error, 630: other |
action | json object | Advice action,2:suggest to delete,1:suggest to audit,0:suggest to pass |
labels | json array | classification information |
labels data structure
Parameter Name | Type | Description |
---|---|---|
label | Number | Classified information, 100: porn, 110: sexy, 200: advertising, 210: two-dimension code, 300: horror, 400: prohibited, 500: political affairs |
subLabels | Number | Subcategory information, which may contain more than one, may be empty |
level | Number | Classification level, 0: Normal, 1: Uncertain, 2: OK |
rate | Number | The confidence score is taken between 0 and 1, with 1 being the highest confidence and 0 being the lowest |
subLabels data structure
Parameter Name | Type | Description |
---|---|---|
subLabel | Number | subclassification ,Please refer to the corresponding subclassification coding table below |
rate | Number | The confidence score is taken between 0 and 1, with 1 being the highest confidence and 0 being the lowest |
details | Number | htiInfos: Hit details |
subclassification coding table
Code | Character | Description |
---|---|---|
10000 | PORN_COMMON | porn |
10001 | PORN_VAGINA | vagina |
10002 | PORN_NIPPLE | nipple |
10003 | PORN_PENNIS | pennis |
10004 | PORN_SEXUAL | sexual |
10005 | PORN_HIP | hip |
10006 | PORN_BLOWJOB | blowjob |
10007 | PORN_CARTOON | cartoon porn |
10008 | PORN_FACE | porn face |
10009 | PORN_CHILD | child porn |
11000 | SEXY_COMMON | sexy vulgar |
20000 | AD_COMMON | advertising |
21000 | QRCODE_COMMON | Qr code |
30000 | TERRORISM_COMMON | violence |
30001 | TERRORISM_GALLERY | violence gallery |
30002 | TERRORISM_FLAG | violence flag |
30003 | TERRORISM_FACE | violence face |
30004 | TERRORISM_LOGO | violence logo |
30005 | TERRORISM_SCENE | terrorism scene |
40000 | CONTRABAND_COMMON | prohibited |
40001 | CONTRABAND_GALLERY | prohibited gallery |
40002 | CONTRABAND_GOOD | contraband |
40003 | CONTRABAND_LOGO | prohibited logo |
40004 | CONTRABAND_BLOOD | bloody |
40005 | CONTRABAND_OFFICE_DRESS | office dress |
40006 | CONTRABAND_INCIVILIZATION | incivilization |
40007 | CONTRABAND_FACE | prohibited face |
40008 | CONTRABAND_SCENE | prohibited scene |
40009 | CONTRABAND_FIRE | fire |
40010 | CONTRABAND_SKULL | skull |
40011 | CONTRABAND_CURRENCY | currency |
50000 | POLITICS_COMMON | politics |
50001 | POLITICS_GALLERY | politics gallery |
50002 | POLITICS_MAP_OF_CHINA | China map |
50003 | POLITICS_LEADERPIC | politics face |
50004 | POLITICS_FLAG | politics flag |
50005 | POLITICS_LOGO | politics logo |
50006 | POLITICS_SCENE | politics scene |
90000 | OTHER_COMMON | others |
90002 | OTHER_USER | custom user list |
90003 | OTHER_IP | custom IP list |
OCR result
OCR function needs extra fee,If you need it, please contact your private business.
OCR array data structure
Parameter Name | Type | Description |
---|---|---|
name | String | Image Name (or Image ID) |
taskId | String | This request data identifier, you can query the latest results of the data according to the identifier |
details | String | OCR detailed information |
details data structure
Parameter Name | Type | Description |
---|---|---|
content | String | The collection of all text information in this image |
lineContents | String | line information |
lineContents data structure
Parameter Name | Type | Description |
---|---|---|
lineContent | String | text information per line |
polygon | String | line coordinates,The top left corner starts to return clockwise relative coordinate information of four points |
The following is the schematic diagram of polygon coordinate information return:
Take the two lines of OCR information returned in the figure as an example. The polygon coordinate information of each line contains 8 relative coordinate points to be returned, starting from the origin of the upper left corner, and returning the origin coordinates of 1-4 points in clockwise sequence. The coordinates of each point from left to right are the distance to the X-axis and Y-axis of the upper left corner of the picture.
face result
face function needs extra fee,If you need it, please contact your private business.
face array data structure
Parameter Name | Type | Description |
---|---|---|
name | String | Image Name (or Image ID) |
taskId | String | This request data identifier, you can query the latest results of the data according to the identifier |
details | String | face detailed information |
details data structure
Parameter Name | Type | Description |
---|---|---|
faceNumber | Number | The number of all faces contained in this image |
faceContents | String | face detailed information |
faceContents data structure
Parameter Name | Type | Description |
---|---|---|
name | String | face name,if it not be recognized will be empty |
x1 | String | Face position information,corresponding to the relative coordinates of the upper left corner abscissa of the face rectangle |
y1 | String | Face position information,corresponding to the relative coordinates of the upper left corner of the face rectangle |
x2 | String | Face position information,corresponding to the relative coordinates of the lower right corner abscissa of the face rectangle |
y2 | String | Face position information,corresponding to the relative coordinates of the lower right corner of the face rectangle |
Request example
Response example
Output result:
Note: Classified information, 100: porn, 110: sexy, 200: advertising, 210: two-dimensional code, 300: horror, 400: prohibited, 500: political
{
"code": 200,
"msg": "ok",
"antispam": [{
"taskId": "2930cd4b13464676a0779ef09706e700",
"status": 0,
"action": 2,
"name": "1234",
"labels": [{
"label": 500,
"level": 2,
"rate": 1.0,
"subLabels": [{
"subLabel": 50003,
"rate": 1.0,
"details": {
"hitInfos": ["XXX"]
}
}]
}, {
"label": 200,
"level": 1,
"rate": 1.0,
"subLabels": []
}, {
"label": 100,
"level": 0,
"rate": 0.9999522,
"subLabels": []
}, {
"label": 110,
"level": 0,
"rate": 0.9999522,
"subLabels": []
}, {
"label": 210,
"level": 0,
"rate": 1.0,
"subLabels": []
}, {
"label": 300,
"level": 0,
"rate": 0.9642776,
"subLabels": []
}, {
"label": 400,
"level": 0,
"rate": 1.0,
"subLabels": []
}]
}, {
"taskId": "0f6260acdb7647e281e41874189206e9",
"status": 0,
"action": 2,
"name": "1234",
"labels": [{
"label": 500,
"level": 2,
"rate": 1.0,
"subLabels": [{
"subLabel": 50003,
"rate": 1.0,
"details": {
"hitInfos": ["XXX"]
}
}]
}, {
"label": 200,
"level": 1,
"rate": 1.0,
"subLabels": []
}, {
"label": 100,
"level": 0,
"rate": 0.9999522,
"subLabels": []
}, {
"label": 110,
"level": 0,
"rate": 0.9999522,
"subLabels": []
}, {
"label": 210,
"level": 0,
"rate": 1.0,
"subLabels": []
}, {
"label": 300,
"level": 0,
"rate": 0.92121917,
"subLabels": []
}, {
"label": 400,
"level": 0,
"rate": 1.0,
"subLabels": []
}]
}],
"ocr": [{
"taskId": "2930cd4b13464676a0779ef09706e700",
"name": "1234",
"details": [{
"content": "直播CCTV1综合",
"lineContents": [{
"lineContent": "直播",
"polygon": [0.7745177268981933, 0.09276469945907592, 0.8768445968627929, 0.0939750075340271, 0.8766385078430176, 0.1636715531349182, 0.7743116855621338, 0.16246124505996704]
}, {
"lineContent": "CCTV1",
"polygon": [0.12932851314544677, 0.09998217821121216, 0.23668222427368163, 0.10091289281845092, 0.2365492343902588, 0.16227685213088988, 0.12919551134109497, 0.16134613752365112]
}, {
"lineContent": "综合",
"polygon": [0.14835870265960693, 0.15775651931762696, 0.23298816680908202, 0.15898795127868653, 0.23278720378875734, 0.21423439979553222, 0.14815772771835328, 0.21300296783447265]
}]
}]
}, {
"taskId": "0f6260acdb7647e281e41874189206e9",
"name": "1234",
"details": [{
"content": "直播CCTV1综合",
"lineContents": [{
"lineContent": "直播",
"polygon": [0.7745157241821289, 0.09276466369628907, 0.8768444061279297, 0.09396190643310547, 0.876640510559082, 0.1636584758758545, 0.7743117809295654, 0.1624612331390381]
}, {
"lineContent": "CCTV1",
"polygon": [0.1293278932571411, 0.0999821662902832, 0.23668241500854492, 0.100907301902771, 0.2365502119064331, 0.16227684020996094, 0.1291956901550293, 0.16135170459747314]
}, {
"lineContent": "综合",
"polygon": [0.14835870265960693, 0.15775651931762696, 0.23298816680908202, 0.15898795127868653, 0.23278720378875734, 0.21423439979553222, 0.14815772771835328, 0.21300296783447265]
}]
}]
}]
"face": [{
"taskId": "57132814c2a24350a337d0a76dd49bbf",
"name": "xxxx",
"details": [{
"faceNumber": 1,
"faceContents": [{
"name": "XXXX",
"x1": 0.41362658,
"y1": 0.18348134,
"x2": 0.50894177,
"y2": 0.37411177
}]
}]
}]
}
``