Пример #1
0
        static void Main(string[] args)
        {
            // 设置为你自己的密钥对
            string appid     = "1000031";
            string secretId  = "AKIDUIDlPDt5mZutfr46NT0GisFcQh1nMOox";
            string secretKey = "ind5yAd55ZspBc7MCANcxEjuXi8YU8RL";
            string userid    = "380549494";



            Conf.Instance().setAppInfo(appid, secretId, secretKey, userid, Conf.Instance().YOUTU_END_POINT);

            string path   = System.IO.Directory.GetCurrentDirectory() + "\\test.jpg";
            string path2  = System.IO.Directory.GetCurrentDirectory() + "\\test.jpg";
            string result = string.Empty;

            result = Youtu.facecompare(path, path2);
            Console.WriteLine(result);
            Console.ReadKey();

            //// 人脸定位 调用demo
            result = Youtu.faceshape(path);
            Console.WriteLine(result);
            Console.ReadKey();

            result = Youtu.getpersonids("group");
            Console.WriteLine(result);
            Console.ReadKey();
        }
Пример #2
0
        static void Main(string[] args)
        {
            // 设置为你自己的密钥对
            string appid     = "1006935";
            string secretId  = "AKIDmtnfLVH3DoWpn5yOIdu5jG5alHacadvt";
            string secretKey = "lmHyGzfLibqK5NAZSQ7dcIYNN72dEOtF";
            string userid    = "380549494";



            Conf.Instance().setAppInfo(appid, secretId, secretKey, userid, Conf.Instance().YOUTU_END_POINT);

            string path   = System.IO.Directory.GetCurrentDirectory() + "\\test.jpg";
            string path2  = System.IO.Directory.GetCurrentDirectory() + "\\test.jpg";
            string result = string.Empty;

            result = Youtu.facecompare(path, path2);
            Console.WriteLine(result);
            Console.ReadKey();

            //// 人脸定位 调用demo
            result = Youtu.faceshape(path);
            Console.WriteLine(result);
            Console.ReadKey();

            result = Youtu.getpersonids("group");
            Console.WriteLine(result);
            Console.ReadKey();
        }
Пример #3
0
        static void Main(string[] args)
        {
            // 设置为你自己的密钥对
            string appid     = "";
            string secretId  = "";
            string secretKey = "";
            string userid    = "";



            Conf.Instance().setAppInfo(appid, secretId, secretKey, userid, Conf.Instance().YOUTU_END_POINT);

            string path   = System.IO.Directory.GetCurrentDirectory() + "\\test.jpg";
            string path2  = System.IO.Directory.GetCurrentDirectory() + "\\test.jpg";
            string result = string.Empty;

            result = Youtu.facecompare(path, path2);
            Console.WriteLine(result);
            Console.ReadKey();

            //// 人脸定位 调用demo
            result = Youtu.faceshape(path);
            Console.WriteLine(result);
            Console.ReadKey();

            result = Youtu.getpersonids("group");
            Console.WriteLine(result);
            Console.ReadKey();
        }
Пример #4
0
    /// <summary>人脸追踪</summary>
    public void FaceTracking(byte[] bytes)
    {
        string result = string.Empty;

        try
        {
            result = Youtu.faceshape(bytes);
        }
        catch (Exception e)
        {
            Debug.Log(e.Message);
        }
    }
Пример #5
0
    /// <summary>人脸融合</summary>
    public void FaceMerge(byte[] bytes, RawImage rImg, Template template)
    {
        string result = string.Empty;

        try
        {
            result = Youtu.faceMerge(bytes, "base64", "[{\"cmd\":\"doFaceMerge\",\"params\":{\"model_id\":\"" + Youtu.GetTemplate(template) + "\"}}]");
            ShowRawimage(result, rImg);
        }
        catch (System.Exception e)
        {
            textLog.text = e.Message;
        }
    }
Пример #6
0
    /// <summary>人脸检测</summary>
    public string FaceDect(byte[] bytes)
    {
        string result = string.Empty;

        try
        {
            result = Youtu.detectface(bytes);
        }
        catch (System.Exception e)
        {
            Debug.LogError(e.Message);
        }
        return(result);
    }
Пример #7
0
        private void btn_facecompare_Click(object sender, EventArgs e)
        {
            string path   = System.IO.Directory.GetCurrentDirectory() + "\\test.jpg";
            string result = Youtu.facecompareurl("http://open.youtu.qq.com/content/img/faceshape.jpg", "http://open.youtu.qq.com/content/img/faceshape.jpg");
            facecompareResponse faceshape = JsonHelper <facecompareResponse> .ToEntity(result);

            if (faceshape.errorcode == 0)
            {
                MessageBox.Show(faceshape.similarity.ToString("0.00"));
            }
            else
            {
                MessageBox.Show(faceshape.errormsg);
            }
        }
Пример #8
0
        private void btn_faceidentify_Click(object sender, EventArgs e)
        {
            string            path      = System.IO.Directory.GetCurrentDirectory() + "\\test.jpg";
            string            result    = Youtu.faceshape(path);
            faceshapeResponse faceshape = JsonHelper <faceshapeResponse> .ToEntity(result);

            if (faceshape.errorcode == 0)
            {
                pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
                pictureBox1.Image    = drawPorint(path, faceshape.face_shape[0]);
            }
            else
            {
                MessageBox.Show(faceshape.errormsg);
            }
        }
Пример #9
0
        private void btn_detectface_Click(object sender, EventArgs e)
        {
            string             path      = System.IO.Directory.GetCurrentDirectory() + "\\test.jpg";
            string             result    = Youtu.detectface(path);
            detectfaceResponse faceshape = JsonHelper <detectfaceResponse> .ToEntity(result);

            if (faceshape.errorcode == 0)
            {
                string dis = "";

                System.Reflection.PropertyInfo[] properties = faceshape.face[0].GetType().GetProperties();
                foreach (System.Reflection.PropertyInfo prop in properties)
                {
                    dis += prop.Name + ":" + prop.GetValue(faceshape.face[0], null).ToString() + "\n";
                }
                MessageBox.Show(dis, "检测结果");
            }
        }
Пример #10
0
        static void Main(string[] args)
        {
            // 设置为你自己的密钥对
            string appid     = "10105350";
            string secretId  = "AKIDdA0iGoRUjx0ru6R5rSH2c1KpNm0WuWyG";
            string secretKey = "FTWQONCtSWZXN2axAufGhx228JYfeS41";
            string userid    = "993801914";



            Conf.Instance().setAppInfo(appid, secretId, secretKey, userid, Conf.Instance().YOUTU_END_POINT);

            string path   = System.IO.Directory.GetCurrentDirectory() + "\\test.jpg";
            string path2  = System.IO.Directory.GetCurrentDirectory() + "\\test.jpg";
            string result = string.Empty;

            //result = Youtu.facecompare(path,path2);
            //Console.WriteLine(result);
            //Console.ReadKey();

            //// 人脸定位 调用demo
            //result = Youtu.faceshape(path);
            //Console.WriteLine(result);
            //Console.ReadKey();

            //result = Youtu.getpersonids("group");
            //Console.WriteLine(result);
            //Console.ReadKey();

            //// 名片OCR
            //path = System.IO.Directory.GetCurrentDirectory() + "\\ocr_card_01.jpg";
            //result = Youtu.bcocr(path);
            //Console.WriteLine(result);
            //Console.ReadKey();

            //// 通用OCR
            //result = Youtu.generalocrurl("http://open.youtu.qq.com/app/img/experience/char_general/ocr_common01.jpg");
            //Console.WriteLine(result);
            //Console.ReadKey();

            //// 行驶证OCR
            //path = System.IO.Directory.GetCurrentDirectory() + "\\ocr_xsz_01.jpg";
            //result = Youtu.driverlicenseocr(path, 0);
            //Console.WriteLine(result);
            //Console.ReadKey();

            List <String> group_ids = new List <string>();

            result = Youtu.multifaceidentifyurl("http://open.youtu.qq.com/app/img/experience/face_img/face_05.jpg?v=1.0", "test", group_ids, 5, 40);
            Console.WriteLine(result);
            //Console.ReadKey();

            result = Youtu.imageterrorismurl("http://open.youtu.qq.com/app/img/experience/terror/img_terror01.jpg");
            Console.WriteLine(result);

            result = Youtu.carcalssifyurl("http://open.youtu.qq.com/app/img/experience/car/car_01.jpg");
            Console.WriteLine(result);

            result = Youtu.creditcardocrurl("http://open.youtu.qq.com/app/img/experience/char_general/ocr_card_1.jpg");
            Console.WriteLine(result);

            result = Youtu.bizlicenseocrurl("http://open.youtu.qq.com/app/img/experience/char_general/ocr_yyzz_01.jpg");
            Console.WriteLine(result);

            result = Youtu.plateocrurl("http://open.youtu.qq.com/app/img/experience/char_general/ocr_license_1.jpg");
            Console.WriteLine(result);

            Console.ReadKey();
        }
Пример #11
0
    public void YoutuFunc(string path)
    {
        //// 人脸对比
        //result = Youtu.facecompare(path, path2);
        //print(result);

        //// 人脸关键点定位 调用demo
        //result = Youtu.faceshape(path);
        //print(result);

        //result = Youtu.getpersonids("group");
        //print(result);

        //// 名片OCR
        //path = System.IO.Directory.GetCurrentDirectory() + "\\ocr_card_01.jpg";
        //result = Youtu.bcocr(path);
        //print(result);

        //// 通用OCR
        //result = Youtu.generalocrurl("http://open.youtu.qq.com/app/img/experience/char_general/ocr_common01.jpg");
        //print(result);

        //// 行驶证OCR
        //path = System.IO.Directory.GetCurrentDirectory() + "\\ocr_xsz_01.jpg";
        //result = Youtu.driverlicenseocr(path, 0);
        //print(result);

        ////多人脸检索
        //List<string> group_ids = new List<string>();
        //result = Youtu.multifaceidentifyurl("http://open.youtu.qq.com/app/img/experience/face_img/face_05.jpg?v=1.0", "test", group_ids, 5, 40);
        //print(result);

        /////识别一个图像是否为暴恐图像
        //result = Youtu.imageterrorismurl("http://open.youtu.qq.com/app/img/experience/terror/img_terror01.jpg");
        //print(result);

        /////自动地检测图片车身以及识别车辆属性
        //result = Youtu.carcalssifyurl("http://open.youtu.qq.com/app/img/experience/car/car_01.jpg");
        //print(result);

        /////银行卡OCR识别,根据用户上传的银行卡图像,返回识别出的银行卡字段信息。
        //result = Youtu.creditcardocrurl("http://open.youtu.qq.com/app/img/experience/char_general/ocr_card_1.jpg");
        //print(result);

        /////营业执照OCR 识别,根据用户上传的营业执照图像,返回识别出的注册号、公司名称、地址字段信息
        //result = Youtu.bizlicenseocrurl("http://open.youtu.qq.com/app/img/experience/char_general/ocr_yyzz_01.jpg");
        //print(result);

        /// 车牌OCR识别,根据用户上传的图像,返回识别出的图片中的车牌号。
        //result = Youtu.plateocrurl("http://open.youtu.qq.com/app/img/experience/char_general/ocr_license_1.jpg");
        //print(result);

        /// 人脸融合,根据用户上传的图像,返回融合后的图像。
        string result = string.Empty;

        try
        {
            Debug.Log("hym");
            StartCoroutine(loadWWW(path));
            Debug.Log(mybytes.ToString());
            //result = Youtu.faceMerge(path, "base64", "[{\"cmd\":\"doFaceMerge\",\"params\":{\"model_id\":\"" + template + "\"}}]");
            result = Youtu.faceMergeFrombytes(mybytes, "base64", "[{\"cmd\":\"doFaceMerge\",\"params\":{\"model_id\":\"" + template + "\"}}]");
            ShowRawimage(result, rawImage);
        }
        catch (System.Exception e)
        {
        }

        //List<string> group_ids = new List<string>();
        //result = Youtu.multifaceidentify(path, "test", group_ids, 5, 40);

        //JsonParse.Multifaceidentify mu = JsonParse.Multifaceidentify.ParseMultifaceidentify(result);
    }