예제 #1
0
        public static void FaceDelete()
        {
            var client = new Face.Face("Api Key", "Secret Key");
            var result = client.User.Delete("uid");

            result = client.User.Delete("uid", new[] { "group1" });
        }
예제 #2
0
        public static void FaceUpdate()
        {
            var client = new Face.Face("Api Key", "Secret Key");
            var image1 = File.ReadAllBytes("图片文件路径");

            var result = client.User.Update(image1, "uid", "groupId", "new user info");
        }
예제 #3
0
        public static void FaceIdentify()
        {
            var client = new Face.Face("Api Key", "Secret Key");
            var image1 = File.ReadAllBytes("图片文件路径");

            var result = client.User.Identify(image1, new[] { "groupId" }, 1, 1);
        }
예제 #4
0
        /// <summary>
        /// 返回指定的用户信息
        /// </summary>
        /// <param name="uid"></param>
        public static string UserInfo(string uid)
        {
            var client = new Face.Face(Config.clientId, Config.clientSecret);
            var result = client.User.GetInfo(uid);

            return(result.ToString());
        }
예제 #5
0
        public static void FaceIdentify()
        {
            var client = new Face.Face(Config.clientId, Config.clientSecret);
            var image1 = File.ReadAllBytes("图片文件路径");

            var result = client.User.Identify(image1, new[] { "groupId" }, 10, 10);
        }
예제 #6
0
        public static void FaceRegister()
        {
            var client = new Face.Face("Api Key", "Secret Key");
            var image1 = File.ReadAllBytes("图片文件路径");

            var result = client.User.Register(image1, "uid", "user info here", new[] { "groupId" });
        }
예제 #7
0
        public static void FaceDelete()
        {
            var client = new Face.Face(Config.clientId, Config.clientSecret);
            var result = client.User.Delete("uid");

            result = client.User.Delete("uid", new[] { "group1" });
        }
예제 #8
0
        /// <summary>
        /// 人脸删除
        /// </summary>
        /// <param name="uid"></param>
        /// <param name="groupId"></param>
        /// <returns></returns>
        public static string FaceDelete(string uid, string groupId)
        {
            var client = new Face.Face(Config.clientId, Config.clientSecret);
            var result = client.User.Delete(uid);

            result = client.User.Delete(uid, new[] { groupId });
            return(result.ToString());
        }
예제 #9
0
        /// <summary>
        /// 人脸识别 人脸库比对
        /// </summary>
        /// <param name="tempImage"></param>
        /// <param name="groupId"></param>
        public static FaceIdentifyModel FaceIdentify(Image tempImage, string groupId, int userTopNum = 1, int faceTopNum = 1)
        {
            var client = new Face.Face(Config.clientId, Config.clientSecret);
            var image1 = ImageHelper.ImageToBytes(tempImage, System.Drawing.Imaging.ImageFormat.Png);

            var result = client.User.Identify(image1, new[] { groupId }, userTopNum, faceTopNum);

            return(result.ToObject <FaceIdentifyModel>());
        }
예제 #10
0
        /// <summary>
        /// 人脸更新
        /// </summary>
        /// <param name="imagePath"></param>
        /// <param name="uid"></param>
        /// <param name="userInfo"></param>
        /// <param name="groupId"></param>
        /// <returns></returns>
        public static string FaceUpdate(string imagePath, string uid, string userInfo, string groupId)
        {
            var client = new Face.Face(Config.clientId, Config.clientSecret);
            var image1 = File.ReadAllBytes(imagePath);

            var result = client.User.Update(image1, uid, groupId, userInfo);

            return(result.ToString());
        }
예제 #11
0
 public static void FaceDetect()
 {
     var client  = new Face.Face("Api Key", "Secret Key");
     var image   = File.ReadAllBytes("图片文件路径");
     var options = new Dictionary <string, object>
     {
         { "face_fields", "beauty,age" }
     };
     var result = client.FaceDetect(image, options);
 }
예제 #12
0
 /// <summary>
 /// 人脸检测
 /// </summary>
 public static void FaceDetect()
 {
     var client  = new Face.Face(Config.clientId, Config.clientSecret);
     var image   = File.ReadAllBytes("图片文件路径");
     var options = new Dictionary <string, object>
     {
         { "face_fields", "age,beauty,expression,faceshape,gender,glasses,landmark,race,qualities" }
     };
     var result = client.FaceDetect(image, options);
 }
예제 #13
0
        public static void FaceMatch()
        {
            var client = new Face.Face("Api Key", "Secret Key");
            var image1 = File.ReadAllBytes("图片文件路径");
            var image2 = File.ReadAllBytes("图片文件路径");
            var image3 = File.ReadAllBytes("图片文件路径");

            var images = new[] { image1, image2, image3 };

            // 人脸对比
            var result = client.FaceMatch(images);
        }
예제 #14
0
        public static void FaceMatch()
        {
            var client = new Face.Face(Config.clientId, Config.clientSecret);
            var image1 = File.ReadAllBytes("图片文件路径");
            var image2 = File.ReadAllBytes("图片文件路径");
            var image3 = File.ReadAllBytes("图片文件路径");

            var images = new[] { image1, image2, image3 };

            // 人脸对比
            var result = client.FaceMatch(images);
        }
예제 #15
0
        /// <summary>
        /// 人脸检测
        /// </summary>
        public static string FaceDetect(Image tempImage)
        {
            var    client       = new Face.Face(Config.clientId, Config.clientSecret);
            string tempProperty = "age,beauty,expression,faceshape,gender,glasses,landmark,race,qualities";
            var    image        = ImageHelper.ImageToBytes(tempImage, System.Drawing.Imaging.ImageFormat.Png);
            var    options      = new Dictionary <string, object>
            {
                { "face_fields", "age,beauty,expression,glasses,race" }
            };
            var result = client.FaceDetect(image, options);

            return(result.ToString());
        }
예제 #16
0
 public static void GroupAddUser()
 {
     var client = new Face.Face("Api Key", "Secret Key");
     var result = client.Group.AddUser(new[] { "toGroupId" }, "uid", "fromGroupId");
 }
예제 #17
0
 public static void GroupUsers()
 {
     var client = new Face.Face("Api Key", "Secret Key");
     var result = client.Group.GetUsers("groupId", 0, 100);
 }
예제 #18
0
 public static void GroupList()
 {
     var client = new Face.Face("Api Key", "Secret Key");
     var result = client.Group.GetAllGroups(0, 100);
 }
예제 #19
0
 public static void UserInfo()
 {
     var client = new Face.Face("Api Key", "Secret Key");
     var result = client.User.GetInfo("uid");
 }
예제 #20
0
 public static void UserInfo()
 {
     var client = new Face.Face(Config.clientId, Config.clientSecret);
     var result = client.User.GetInfo("uid");
 }
예제 #21
0
 public static void GroupUsers()
 {
     var client = new Face.Face(Config.clientId, Config.clientSecret);
     var result = client.Group.GetUsers("groupId", 0, 100);
 }
예제 #22
0
 public static void GroupAddUser()
 {
     var client = new Face.Face(Config.clientId, Config.clientSecret);
     var result = client.Group.AddUser(new[] { "toGroupId" }, "uid", "fromGroupId");
 }
예제 #23
0
 public Font(Face.Face face)
 {
     Handle = Api.hb_font_create(face.Handle);
 }
예제 #24
0
 public static void GroupDeleteUser()
 {
     var client = new Face.Face("Api Key", "Secret Key");
     var result = client.Group.DeleteUser(new[] { "groupId" }, "uid");
 }
예제 #25
0
 public static void GroupList()
 {
     var client = new Face.Face(Config.clientId, Config.clientSecret);
     var result = client.Group.GetAllGroups(0, 100);
 }
예제 #26
0
 public FaceDemo(string apiKey, string secretKey)
 {
     client = new Face.Face(apiKey, secretKey);
 }
예제 #27
0
 public static void GroupDeleteUser()
 {
     var client = new Face.Face(Config.clientId, Config.clientSecret);
     var result = client.Group.DeleteUser(new[] { "groupId" }, "uid");
 }