예제 #1
0
        public static IEnumerable <Candidate> IdentifyCandidates(this IFaceApi api, string imageDataUrl, string groupName)
        {
            if (imageDataUrl != null)
            {
                var strData = imageDataUrl.Split(',').Skip(1).FirstOrDefault();
                if (strData != null)
                {
                    var binData = Convert.FromBase64String(strData);
                    if (binData != null)
                    {
                        var faceIDs = api.Detect(binData);
                        if (faceIDs != null && faceIDs.Length > 0)
                        {
                            return(api.Identify(groupName, faceIDs));
                        }
                    }
                }
            }

            return(Enumerable.Empty <Candidate>());
        }
예제 #2
0
 public Guid[] Detect(byte[] imageData)
 {
     return(Client.Detect(imageData));
 }