@@ -406,20 +406,23 @@ def get_object(self, Bucket, Key, **kwargs):
406406
407407 return response
408408
409- def get_object_sensitive_content_recognition (self , Bucket , Key , DetectType , ** kwargs ):
409+ def get_object_sensitive_content_recognition (self , Bucket , Key , DetectType , Interval = None , MaxFrames = None , BizType = None , ** kwargs ):
410410 """文件内容识别接口 https://cloud.tencent.com/document/product/460/37318
411411
412412 :param Bucket(string): 存储桶名称.
413413 :param Key(string): COS路径.
414414 :param DetectType(int): 内容识别标志,位计算 1:porn, 2:terrorist, 4:politics, 8:ads
415+ :param Interval(int): 截帧频率,GIF图/长图检测专用,默认值为0,表示只会检测GIF图/长图的第一帧.
416+ :param MaxFrames(int): 最大截帧数量,GIF图/长图检测专用,默认值为1,表示只取GIF的第1帧图片进行审核,或长图不做切分识别.
417+ :param BizType(string): 审核策略的唯一标识,由后台自动生成,在控制台中对应为Biztype值.
415418 :param kwargs(dict): 设置下载的headers.
416419 :return(dict): 下载成功返回的结果,dict类型.
417420
418421 .. code-block:: python
419422
420423 config = CosConfig(Region=region, SecretId=secret_id, SecretKey=secret_key, Token=token) # 获取配置对象
421424 client = CosS3Client(config)
422- # 下载cos上的文件到本地
425+ # 识别cos上的图片
423426 response = client.get_object_sensitive_content_recognition(
424427 Bucket='bucket',
425428 DetectType=CiDetectType.PORN | CiDetectType.POLITICS,
@@ -458,6 +461,12 @@ def get_object_sensitive_content_recognition(self, Bucket, Key, DetectType, **kw
458461 detect_type += 'ads'
459462
460463 params ['detect-type' ] = detect_type
464+ if Interval :
465+ params ['interval' ] = Interval
466+ if MaxFrames :
467+ params ['max-frames' ] = MaxFrames
468+ if BizType :
469+ params ['biz-type' ] = BizType
461470 params = format_values (params )
462471
463472 url = self ._conf .uri (bucket = Bucket , path = Key )
0 commit comments