API | 操作描述 |
对对象存储(Cloud Object Storage,COS)存量数据进行涉黄、违法违规以及广告引导类图片的扫描 | |
对多个图片进行批量审核 | |
本接口用于主动查询指定的图片审核任务结果 |
QCloudSyncImageRecognitionRequest * request = [[QCloudSyncImageRecognitionRequest alloc]init];// 存储桶名称,格式为 BucketName-APPIDrequest.bucket = @"bucket";// 文件所在地域request.regionName = @"regionName";// 对象键,是对象在 COS 上的完整路径,如果带目录的话,格式为 "dir1/object1"request.object = @"***.jpg";// 审核类型,拥有 porn(涉黄识别)、ads(广告识别)// 用户可选择多种识别类型,例如 detect-type=porn,ads 表示对图片进行涉黄及广告审核// 可以使用或进行组合赋值 如: QCloudRecognitionPorn | QCloudRecognitionTerroristrequest.detectType = QCloudRecognitionPorn | QCloudRecognitionTerrorist | QCloudRecognitionPolitics | QCloudRecognitionAds;[request setFinishBlock:^(QCloudImageRecognitionResult * _Nullable result, NSError * _Nullable error) {// outputObject 提交审核反馈信息,详细字段请查看api文档或者SDK源码// QCloudImageRecognitionResult 类;}];[[QCloudCOSXMLService defaultCOSXML] SyncImageRecognition:request];
let request : QCloudSyncImageRecognitionRequest = QCloudSyncImageRecognitionRequest();// 存储桶名称,格式为 BucketName-APPIDrequest.bucket = "bucket";// 文件所在地域request.regionName = "regionName";// 对象键,是对象在 COS 上的完整路径,如果带目录的话,格式为 "dir1/object1"request.object = "***.jpg";// 审核类型,拥有 porn(涉黄识别)、ads(广告识别)// 用户可选择多种识别类型,例如 detect-type=porn,ads 表示对图片进行涉黄及广告审核// 可以使用或进行组合赋值 如: QCloudRecognitionPorn | QCloudRecognitionTerroristrequest.detectType = QCloudRecognitionEnum(rawValue: QCloudRecognitionEnum.porn.rawValue | QCloudRecognitionEnum.ads.rawValue)!request.finishBlock = { (result, error) in// outputObject 提交审核反馈信息,详细字段请查看api文档或者SDK源码// QCloudImageRecognitionResult 类;}QCloudCOSXMLService.defaultCOSXML().syncImageRecognition(request);
QCloudBatchimageRecognitionRequest * request = [[QCloudBatchimageRecognitionRequest alloc]init];request.bucket = @"bucket";// 文件所在地域request.regionName = @"regionName";NSMutableArray * input = [NSMutableArray new];// 待审核的图片对象QCloudBatchRecognitionImageInfo * input1 = [QCloudBatchRecognitionImageInfo new];input1.Object = @"***.jpg";[input addObject:input1];QCloudBatchRecognitionImageInfo * input2 = [QCloudBatchRecognitionImageInfo new];input2.Object = @"***.jpg";[input addObject:input2];// 待审核的图片对象数组request.input = input;request.detectType = QCloudRecognitionPorn | QCloudRecognitionTerrorist | QCloudRecognitionPolitics | QCloudRecognitionAds;[request setFinishBlock:^(QCloudBatchImageRecognitionResult * _Nullable result, NSError * _Nullable error) {// outputObject 审核结果,详细字段请查看api文档或者SDK源码// QCloudBatchImageRecognitionResult 类;}];[[QCloudCOSXMLService defaultCOSXML] BatchImageRecognition:request];
let request = QCloudBatchimageRecognitionRequest();request.bucket = "bucket";// 文件所在地域request.regionName = "regionName";// 待审核的图片对象let input1 = QCloudBatchRecognitionImageInfo();input1.object = "***.jpg";let input2 = QCloudBatchRecognitionImageInfo();input2.object = "***.jpg";// 待审核的图片对象数组request.input = [input1,input2];request.detectType = QCloudRecognitionEnum(rawValue: QCloudRecognitionEnum.porn.rawValue | QCloudRecognitionEnum.ads.rawValue)!request.setFinish { outputObject, error in// outputObject 审核结果,详细字段请查看api文档或者SDK源码// QCloudBatchImageRecognitionResult 类;}QCloudCOSXMLService.defaultCOSXML().batchImageRecognition(request);
QCloudGetImageRecognitionRequest * request = [[QCloudGetImageRecognitionRequest alloc]init];// 存储桶名称,格式为 BucketName-APPIDrequest.bucket = @"examplebucket-1250000000";// 文件所在地域request.regionName = @"regionName";// 同步审核或批量审核返回结果的jobidrequest.jobId = @"jobid";request.finishBlock = ^(QCloudImageRecognitionResult * outputObject, NSError *error) {// outputObject 审核结果 包含用于查询的job id,详细字段请查看api文档或者SDK源码// QCloudImageRecognitionResult 类;};[[QCloudCOSXMLService defaultCOSXML] GetImageRecognition:request];
let request = QCloudGetImageRecognitionRequest();// 存储桶名称,格式为 BucketName-APPIDrequest.bucket = "examplebucket-1250000000";request.regionName = "regionName";// 同步审核或批量审核返回结果的jobidrequest.jobId = "jobid";request.setFinish { outputObject, error in// outputObject 审核结果 包含用于查询的job id,详细字段请查看api文档或者SDK源码// QCloudWebRecognitionResult 类;};QCloudCOSXMLService.defaultCOSXML().getImageRecognition(request);
本页内容是否解决了您的问题?