private static void ClarityDetect(String token, String endpoint) { String dataUrl = ""; // The obs url of file float threshold = 0.8f; // The clarity confidence interval,default 0.8f // post data by native file String data = utils.ConvertFileToBase64("../../data/moderation-clarity-detect.jpg"); String reslut = Moderation.ClarityDetectToken(token, data, dataUrl, threshold, endpoint); Console.WriteLine(reslut); dataUrl = "https://ais-sample-data.obs.cn-north-1.myhwclouds.com/vat-invoice.jpg"; // post data by obs url reslut = Moderation.ClarityDetectToken(token, "", dataUrl, threshold, endpoint); Console.WriteLine(reslut); Console.ReadKey(); }
private static void ClarityDetect(String token, String endpoint) { // The obs url of file String dataUrl = ""; // The clarity confidence interval,default 0.8f float threshold = 0.8f; // post data by native file String data = utils.ConvertFileToBase64("../../data/moderation-clarity-detect.jpg"); String reslut = Moderation.ClarityDetectToken(token, data, dataUrl, threshold, endpoint); Console.WriteLine(reslut); // The OBS link must match the region, and the OBS resources of different regions are not shared dataUrl = "https://ais-sample-data.obs.cn-north-1.myhuaweicloud.com/vat-invoice.jpg"; // post data by obs url reslut = Moderation.ClarityDetectToken(token, "", dataUrl, threshold, endpoint); Console.WriteLine(reslut); Console.ReadKey(); }