`
king_c
  • 浏览: 214676 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

openface 人脸识别开放平台

    博客分类:
  • c#
 
阅读更多
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QSFaceSDK;
namespace SDKTest
{
	class Program
	{
		public static string image_file_1 = "林志玲_1.jpg";
		static void Main(string[] args)
		{
			int app_key = 1000;
			string app_secret = "dd6da32bcd4c356ebf42733054e8a6ae";
			//初始化OpenFace核心对象
			OpenFace openface = new OpenFace(app_key, app_secret);
			if (openface.state == 1)//state == 1 表示初始化成功 
			{
				//调用本地图片人脸分析接口(同步返回)
				Response response = openface.FaceAnalysis(image_file_1, "林志玲");
				if (response != null)
				{
					int code = response.status.code;
					TaskModel result = response.result.taskInfo;
					if(1000 == code)
					{
						//打印出返回的人脸分析信息
					}
				}
			}
			else
			{
				if (openface.state == 0)
				{
					Console.WriteLine("QSFaceSDK.dll 需要在联网状态下使用!");
				}
				else if (openface.state == -1)
				{
					Console.WriteLine("[Key | Secret]不合法!");
				}
			}
		}
	}
}

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics