コード例 #1
0
        public virtual async Task <Face[]> DetectAsync(Stream imageStream, bool returnFaceId = true, bool returnFaceLandmarks = false, IEnumerable <FaceAttributeType> returnFaceAttributes = null)
        {
            var qs = GetDetectQS(returnFaceId, returnFaceLandmarks, returnFaceAttributes);

            var response = await RepositoryClient.SendOctetStreamPostAsync(ApiKeys.Face, $"{ApiKeys.FaceEndpoint}detect{qs}", imageStream);

            return(JsonConvert.DeserializeObject <Face[]>(response));
        }
コード例 #2
0
        public virtual async Task <Emotion[]> RecognizeAsync(Stream imageStream, Rectangle[] faceRectangles)
        {
            var qs = GetRectangleQS(faceRectangles);

            var response = await RepositoryClient.SendOctetStreamPostAsync(ApiKeys.Emotion, $"{ApiKeys.EmotionEndpoint}recognize{qs}", imageStream);

            return(JsonConvert.DeserializeObject <Emotion[]>(response));
        }
コード例 #3
0
        public virtual async Task <AnalysisResult> AnalyzeImageAsync(Stream imageStream, IEnumerable <VisualFeature> visualFeatures = null, IEnumerable <string> details = null)
        {
            var qs       = GetAnalyzeQuerystring(visualFeatures, details);
            var response = await RepositoryClient.SendOctetStreamPostAsync(ApiKeys.ComputerVision, $"{ApiKeys.ComputerVisionEndpoint}analyze{qs}", imageStream);

            return(JsonConvert.DeserializeObject <AnalysisResult>(response));
        }
コード例 #4
0
        public virtual async Task <UploadCatalogFileResponse> UploadCatalogFileAsync(string modelId, string catalogDisplayName, Stream stream)
        {
            var response = await RepositoryClient.SendOctetStreamPostAsync(ApiKeys.Recommendations, $"{ApiKeys.RecommendationsEndpoint}{modelsUrl}{modelId}/catalog?catalogDisplayName={catalogDisplayName}", stream);

            return(JsonConvert.DeserializeObject <UploadCatalogFileResponse>(response));
        }
コード例 #5
0
        public virtual async Task <Verification> VerifyAsync(Stream audioStream, Guid id)
        {
            var response = await RepositoryClient.SendOctetStreamPostAsync(ApiKeys.SpeakerRecognition, $"{ApiKeys.SpeakerRecognition}verify?verificationProfileId={id.ToString("D")}", audioStream);

            return(JsonConvert.DeserializeObject <Verification>(response));
        }