Ejemplo n.º 1
0
        void BtnIdentify_Click(object sender, EventArgs e)
        {
            var imagePath = GetImageFiles()?[0];

            if (imagePath == null)
            {
                return;
            }
            picBoxImage.Image = Image.FromFile(imagePath);
            var result = _faceService.FaceIdentify(imagePath, txtGroupId.Text, 1);

            txtLog1.Text = JsonConvert.SerializeObject(result);
            AppendLogWarning("识别到 {0} 个用户", result.ResultNum);
            for (int i = 0; i < result.ResultNum; i++)
            {
                AppendLogWarning("-----------------------");
                AppendLogWarning("第 {0} 个用户信息(匹配度:{1}):", i + 1, result.Result[i].Scores[0]);
                AppendLog("用户id:{0}", result.Result[i].UserId);
                AppendLog("用户信息:{0}", result.Result[i].UserInfo);
            }
        }