public static JObject FaceDetect(string imagePath) { var client = new Face.Face(API_KEY, SECRET_KEY); var image = File.ReadAllBytes(imagePath); var options = new Dictionary <string, object> { { "face_fields", "age,beauty,expression,faceshape,gender,glasses,landmark,race,qualities" } }; var result = client.FaceDetect(image, options); return(result); }
public static void FaceDetect() { var client = new Baidu.Aip.Face.Face(API_KEY, SECRET_KEY); var image = File.ReadAllBytes(Form1.filename1); var options = new Dictionary <string, object>() { { "face_fields", "beauty,age" } }; var result = client.FaceDetect(image, options)["result"]; text = result.ToString(); MessageBox.Show(text); }