コード例 #1
0
 public JsonResult Url([FromBody] ClassifyUrlRequestViewModel model)
 {
     try
     {
         var client   = new VisualRecognitionClient(model.ApiKey);
         var response = client.FaceDetectionUrl(model.Url);
         return(Json(response));
     }
     catch (Exception exc)
     {
         return(JsonError(exc));
     }
 }
コード例 #2
0
        public JsonResult ClassifyUrl([FromBody] ClassifyUrlRequestViewModel model)
        {
            try
            {
                var client  = new VisualRecognitionClient(model.ApiKey);
                var request = new VisualRecognitionClassifyUrl(model.Url)
                {
                    Classifiers = model.Classifiers,
                    Owners      = model.Owners,
                    Threshold   = model.Threshold
                };

                var response = client.ClassifyImageUrl(request);
                return(Json(response));
            }
            catch (Exception exc)
            {
                return(JsonError(exc));
            }
        }