To enable LVB porn detection, you need to enable LVB screencapturing first either in the LVB Console or through API. This document describes how to implement LVB porn detection through API.
As the LVB porn detection feature is based on the LVB screencapturing feature, you have to enable LVB screencapturing first before you can enable LVB porn detection. The steps are as follows:
Call CreateLiveSnapshotTemplate and set PornFlag
to 1 to create a porn detection-enabled LVB screencapturing template.
Call CreateLiveSnapshotRule to create a porn detection-enabled LVB screencapturing rule and associate the LVB screencapturing template ID created in step 1 to the AppID
, DomainName
, AppName
, and StreamName
of the live stream that needs to undergo porn detection.
After a porn detection-enabled LVB screencapturing rule is created, the porn detection feature will be automatically enabled for new live streams. If you want to enable porn detection for a live stream that is in progress, you need to stop and restart the stream for the feature to take effect.
After LVB porn detection is enabled, you can configure the registered callback domain name in the porn detection callback template to have the LVB backend call back the porn detection result.
Note:
By default, only suspicious results will be called back.
Call CreateLiveCallbackTemplate and set PornCensorshipNotifyUrl
to your domain name to create an LVB porn detection callback template.
Call CreateLiveCallbackRule to create a porn detection-enabled LVB screencapturing rule and associate the LVB screencapturing template ID created in the previous step to the AppId
, DomainName
, and AppName
of the live stream that needs to undergo porn detection.
The LVB backend sends the porn detection result to your registered domain name through an HTTP POST request where the result is stored in the HTTP body in JSON format. You can determine whether the live stream is pornographic by the type
field alone.
Note:
We recommend you use the
type
of an image to judge whether it is pornographic. As the detection system cannot achieve 100% accuracy, there may be false positives or false negatives, and human confirmation is recommended.
Parameter | *Required * | Data Type | Description |
---|---|---|---|
tid | Yes | Number | Alert policy ID. Video content alert: 20001 |
streamId | No | String | Stream name |
channelId | No | string | Channel ID |
img | Yes | string | Link to alerted image |
type | Yes | Array | Image type. 0: normal, 1: pornographic, 2: sexy, 3: politically sensitive, 4: non-compliant, 5: terrorism, 6–9: others |
confidence | Yes | Number | Confidence of detected pornographic information in the range of 0–100, which is an overall score of normalScore , hotScore , and pornScore |
normalScore | Yes | Number | Normal score of image |
hotScore | Yes | Number | Sexual score of image |
pornScore | Yes | Number | Pornographic score of image |
level | No | Number | Image level |
ocrMsg | No | string | OCR information of image (if any) |
screenshotTime | Yes | Number | Screencaptured time |
sendTime | Yes | Number | Request sent time (UNIX timestamp) |
abductionRisk | No | Array | An array containing the AbductionRisk structure |
faceDetails | No | Array | An array containing the face attribute (faceDetail ) structure |
gameDetails | No | Object | Game details |
polityScore | No | Number | Politically sensitive score of image |
illegalScore | No | Number | Non-compliant score of image |
terrorScore | No | Number | Terrorism score of image |
similarScore | No | Number | Similarity score of image |
stream_param | No | String | Push parameter |
app | No | String | Push domain name |
appid | No | Number | Business ID |
appname | No | String | Push path |
Parameter | *Required * | Data Type | Description |
---|---|---|---|
level | Yes | Number | Risk level in the range of 0–4. The higher the number, the higher the risk. 3 and 4 indicate maliciousness and should be handled |
type | Yes | Number | Risk type. 20002: porn |
*Parameter Name | *Required * | Type | Description |
---|---|---|---|
gender | No | Number | Gender [0 (female)–100 (male)] |
age | No | Number | Age |
expression | No | Number | Expression [0 (normal)–50 (smile)–100 (laugh)] |
beauty | No | Number | Charm [0–100] |
x | No | Number | x coordinate of the top-left corner of face frame |
y | No | Number | y coordinate of the top-left corner of face frame |
width | No | Number | Face frame width |
height | No | Number | Face frame height |
*Parameter Name | *Required * | Type | Description |
---|---|---|---|
battlegrounds | No | Object | PUBG information |
gameList | No | Array | Game list |
*Parameter Name | *Required * | Type | Description |
---|---|---|---|
name | No | String | Game name |
confidence | No | Number | Probability |
HTTP Body:
{
"ocrMsg":"",
"type":[2],
"confidence":0,
"normalScore":2,
"hotScore":97,
"pornScore":0,
"screenshotTime":1575513174,
"level":0,
"img":"http://test-10000.cos.ap-shanghai.myqcloud.com/2019-12-05/teststream-screenshot-10-32-54-960x540.jpg",
"abductionRisk":[ ],
"faceDetails":[ ],
"sendTime":1575513176,
"illegalScore":0,
"polityScore":0,
"similarScore":0,
"terrorScore":0,
"tid":20001,
"streamId":"teststream",
"channelId":"teststream",
"stream_param":"txSecret=40f38f69f574fd51126c421a3d96c374&txTime=5DEBEC80",
"app":"testlive.myqcloud.com",
"appname":"live",
"appid":10000
}
LVB porn detection can be disabled by deleting the screencapturing rule or modifying the screencapturing template. Both deletion and modification are effective only for new live streams. If you want to disable LVB porn detection for a live stream that has already started, you have to stop and restart the stream.
Call DeleteLiveSnapshotRule to delete the corresponding LVB screencapturing rule under DomainName
, AppName
, and StreamName
by template ID.
Call ModifyLiveSnapshotTemplate to set the porn detection flag of the LVB screencapturing template to 0.
Was this page helpful?