@@ -400,20 +400,23 @@ def get_object(self, Bucket, Key, **kwargs):
400400
401401 return response
402402
403- def get_object_sensitive_content_recognition (self , Bucket , Key , DetectType , ** kwargs ):
403+ def get_object_sensitive_content_recognition (self , Bucket , Key , DetectType , Interval = None , MaxFrames = None , BizType = None , ** kwargs ):
404404 """文件内容识别接口 https://cloud.tencent.com/document/product/460/37318
405405
406406 :param Bucket(string): 存储桶名称.
407407 :param Key(string): COS路径.
408408 :param DetectType(int): 内容识别标志,位计算 1:porn, 2:terrorist, 4:politics, 8:ads
409+ :param Interval(int): 截帧频率,GIF图/长图检测专用,默认值为0,表示只会检测GIF图/长图的第一帧.
410+ :param MaxFrames(int): 最大截帧数量,GIF图/长图检测专用,默认值为1,表示只取GIF的第1帧图片进行审核,或长图不做切分识别.
411+ :param BizType(string): 审核策略的唯一标识,由后台自动生成,在控制台中对应为Biztype值.
409412 :param kwargs(dict): 设置下载的headers.
410413 :return(dict): 下载成功返回的结果,dict类型.
411414
412415 .. code-block:: python
413416
414417 config = CosConfig(Region=region, SecretId=secret_id, SecretKey=secret_key, Token=token) # 获取配置对象
415418 client = CosS3Client(config)
416- # 下载cos上的文件到本地
419+ # 识别cos上的图片
417420 response = client.get_object_sensitive_content_recognition(
418421 Bucket='bucket',
419422 DetectType=CiDetectType.PORN | CiDetectType.POLITICS,
@@ -452,6 +455,12 @@ def get_object_sensitive_content_recognition(self, Bucket, Key, DetectType, **kw
452455 detect_type += 'ads'
453456
454457 params ['detect-type' ] = detect_type
458+ if Interval :
459+ params ['interval' ] = Interval
460+ if MaxFrames :
461+ params ['max-frames' ] = MaxFrames
462+ if BizType :
463+ params ['biz-type' ] = BizType
455464 params = format_values (params )
456465
457466 url = self ._conf .uri (bucket = Bucket , path = Key )
0 commit comments