对象存储

  • 审核结果回调

    最近更新时间:2018-05-16 19:10:39

    审核结果回调
    无论是增量图片还是存量图片,都可以通过回调来获取审核结果。回调地址可以在“图片内容审核设置”的“高级设置”部分进行设置。同时,存量图片审核的结果还会保存到用户指定的七牛云存储空间中,文件地址可以在高级设置中进行设置。

    注意 在2018-5-16之前设定的增量审核,回调格式使用的旧的格式,请参考"3.增量图片审核回调格式(旧的回调格式)"。如果用户在2018-5-16之后添加/修改的增量审核设置,回调格式将会是新的格式,请参考“1.增量图片审核回调格式”。

    1.增量图片审核回调格式

    POST /xxxx  Http/1.1
    Content-Type: application/json
    
    {
        "id": "z0.0AC8145700002A9F0000000AD61B9CD5", 
        "pipeline": "0.default", 
        "code": 0, 
        "desc": "The fop was completed successfully", 
        "reqid": "Wp4AAIxsWr63_i4V", 
        "inputBucket": "censor3", 
        "inputKey": "filter6/test2/pulp-test3.png", 
        "items": [
            {
                "cmd": "image-censor/pulp/terror/politician|bucket-inspect/v1/pulp/0.98/sexy/1/terror/0.60/politician/0.60", 
                "code": 0, 
                "desc": "The fop was completed successfully", 
                "result": {
                    "disable": true, 
                    "result": {
                        "code": 0, 
                        "message": "", 
                        "result": {
                                                "label": 1, 
                            "review": false, 
                            "score": 0.99426526
                            "details": [
                                {
                                    "label": 0, 
                                    "review": false, 
                                    "score": 0.99426526, 
                                    "type": "pulp"
                                }, 
                                {
                                    "label": 0, 
                                    "more": [
                                        {
                                            "boundingBox": {
                                                "pts": [
                                                    [
                                                        861, 
                                                        106
                                                    ], 
                                                    [
                                                        1021, 
                                                        106
                                                    ], 
                                                    [
                                                        1021, 
                                                        364
                                                    ], 
                                                    [
                                                        861, 
                                                        364
                                                    ]
                                                ], 
                                                "score": 0.99951386
                                            }, 
                                            "value": {
                                                "review": false, 
                                                "score": 0.22625886
                                            }
                                        }
                                    ], 
                                    "review": false, 
                                    "score": 0, 
                                    "type": "politician"
                                }, 
                                {
                                    "label": 0, 
                                    "review": false, 
                                    "score": 0.8930834, 
                                    "type": "terror"
                                }
                            ], 
    
                        }
                    }
                }, 
                "returnOld": 0
            }
        ]
    }
    

    返回字段说明:

    字段 取值 说明
    items.result.result Object 表示每张图片的检测结果。
    items.result.result.result.label int 是否违规,0:不违规;1:违规
    items.result.result.result.review bool 是否需要人工复审该图片,true需要false不需要
    items.result.result.result.score float 是否违规的置信度
    items.result.result.result.details Object 返回的是items.cmd中包含的审核类型命令的具体返回信息。例如,上面的示例为“image-censor/pulp/terror/politician“,包含pulp,terror,politician。那么这里就包含"type": "pulp"、"type": "politician"和"type": "terror"的三个具体的结果。
    disable boolean 文件是否被disable,true表示禁用false不禁用。禁用的标准与用户在界面上设定的禁用阈值相关。

    2.存量图片审核回调格式

    {
    "keys":["filter7//5afc0cf25f171c000735adee/20180516T185034_20180516T185043__15", ...]
    }
    

    返回字段说明:

    字段 取值 说明
    keys []string 存量图片审核的结果文件的key

    存量图片审核的结果文件格式为:

    qiniu://z0/censor3/filter2/test1/xiginping.jpg    {"code":0,"message":"","result":{"label":1,"score":0.8452103,"review":false,"details":[{"type":"pulp","label":2,"score":0.4887098,"review":true},{"type":"politician","label":1,"score":0.8452103,"review":false,"more":[{"boundingBox":{"pts":[[133,123],[357,123],[357,410],[133,410]],"score":0.9999896},"value":{"name":"习近平","score":0.8452103,"review":false},"sample":{"url":"http://p4wgdf8lr.bkt.clouddn.com/politician/sample/img-329d83050dee127116c962f3d3b635eb.jpg","pts":[[215,74],[326,74],[326,209],[215,209]]}}]}]}}
    qiniu://z0/censor3/filter2/test1/CoffeeRoom.jpg    {"code":0,"message":"","result":{"label":0,"score":0.99996346,"review":false,"details":[{"type":"pulp","label":2,"score":0.99996346,"review":false},{"type":"politician","label":0,"score":0,"review":false,"more":[]}]}}
    ...
    

    3.增量图片审核回调格式(旧的回调格式)

    POST /xxxx  Http/1.1
    Content-Type: application/json
    
    {
        "id": <job.id>,
        "pipeline": <pipeline>,
        "code": 0,
        "desc": "The fop was completed successfully",
        "reqid": <reqid>,
        "inputBucket": <bucket>,
        "inputKey": <key>,
        "items": [
            {
                "cmd": "qpulp|bucket-inspect/v1",
                "code": 0,
                "desc": "The fop was completed successfully",
                "result": {
                    "disable": true,
                    "result": {
                        "code": 0,
                        "message": "",
                        "result": {
                            "label": 0,
                            "review": false,
                            "score": 0
                        }
                    }
                },
                "returnOld": 0
            }
        ]
    }
    

    返回字段说明:

    字段 取值 说明
    items.result.result Object 每个元素表示每张图片的检测结果:。
    label:介于0-2间的整数,表示该图像被机器判定为哪个分类,分别对应: 0色情;1性感;2正常,三种分类的具体解释如下。
    0色情:有明显的敏感部分裸露的图片,血腥图片,描述性交行为的体位或姿势和色情场景的图片。注意,儿童色情的内容,也被归为0。
    1性感:衣着暴露但没有裸露敏感部位。次类跨度比较大,从露出皮肤较多的图片到性感写真、诱惑自拍等,区分0和1最重要的规则为是否有裸露敏感部位。注意,孕妇自拍露肚子的图也被归为了1。
    2正常:非色情,非性感图片。
    review: 是否需要人工复审该图片,鉴黄服务是否对结果确定。true需要false不需要
    score:介于0-1间的浮点数,表示该图像被识别为某个分类的概率值,概率越高、机器越肯定;您可以根据您的需求确定需要直接封禁的评分界限
    disable bool 文件是否被disable
    以上内容是否对您有帮助?
  • 提交工单