API | 操作描述 |
对对象存储(Cloud Object Storage,COS)存量数据进行涉黄、违法违规以及广告引导类图片的扫描 |
using COSXML.Model.CI;using COSXML.Auth;using COSXML;namespace COSSnippet{public class PictureOperationModel {private CosXml cosXml;PictureOperationModel() {CosXmlConfig config = new CosXmlConfig.Builder().SetRegion("COS_REGION") // 设置默认的地域, COS 地域的简称请参照 https://www.tencentcloud.com/document/product/436/6224?from_cn_redirect=1.Build();string secretId = "SECRET_ID"; // 云 API 密钥 SecretId, 获取 API 密钥请参照 https://console.tencentcloud.com/cam/capistring secretKey = "SECRET_KEY"; // 云 API 密钥 SecretKey, 获取 API 密钥请参照 https://console.tencentcloud.com/cam/capilong durationSecond = 600; //每次请求签名有效时长,单位为秒QCloudCredentialProvider qCloudCredentialProvider = new DefaultQCloudCredentialProvider(secretId,secretKey, durationSecond);this.cosXml = new CosXmlServer(config, qCloudCredentialProvider);}/// 图片审核public void SensitiveContentRecognition(){// 存储桶名称,此处填入格式必须为 bucketname-APPID, 其中 APPID 获取参考 https://console.tencentcloud.com/developerstring bucket = "examplebucket-1250000000";string key = "exampleobject"; //对象键//.cssg-snippet-body-start:[sensitive-content-recognition]SensitiveContentRecognitionRequest request =new SensitiveContentRecognitionRequest(bucket, key, "ads");SensitiveContentRecognitionResult result = cosXml.SensitiveContentRecognition(request);}static void Main(string[] args){PictureOperationModel m = new PictureOperationModel();/// 图片审核m.SensitiveContentRecognition();}}}
本页内容是否解决了您的问题?