コード例 #1
0
ファイル: FaceDemo.cs プロジェクト: xiecunjing/dotnet-sdk
        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
ファイル: FaceDemo.cs プロジェクト: xiecunjing/dotnet-sdk
        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
ファイル: FaceDemo.cs プロジェクト: xiecunjing/dotnet-sdk
        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
ファイル: FaceDemo.cs プロジェクト: xiecunjing/dotnet-sdk
        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
ファイル: FaceDemo.cs プロジェクト: xiecunjing/dotnet-sdk
 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
ファイル: FaceDemo.cs プロジェクト: xiecunjing/dotnet-sdk
        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
ファイル: FaceDemo.cs プロジェクト: xiecunjing/dotnet-sdk
 public static void GroupAddUser()
 {
     var client = new Face.Face("Api Key", "Secret Key");
     var result = client.Group.AddUser(new[] { "toGroupId" }, "uid", "fromGroupId");
 }
コード例 #17
0
ファイル: FaceDemo.cs プロジェクト: xiecunjing/dotnet-sdk
 public static void GroupUsers()
 {
     var client = new Face.Face("Api Key", "Secret Key");
     var result = client.Group.GetUsers("groupId", 0, 100);
 }
コード例 #18
0
ファイル: FaceDemo.cs プロジェクト: xiecunjing/dotnet-sdk
 public static void GroupList()
 {
     var client = new Face.Face("Api Key", "Secret Key");
     var result = client.Group.GetAllGroups(0, 100);
 }
コード例 #19
0
ファイル: FaceDemo.cs プロジェクト: xiecunjing/dotnet-sdk
 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
ファイル: FaceDemo.cs プロジェクト: xiecunjing/dotnet-sdk
 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
ファイル: FaceDemo.cs プロジェクト: yuanhuaming/BaiduAiCore
 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");
 }