基本信息
源码名称:net core 版本的百度AI 人脸demo
源码大小:12.60M
文件格式:.rar
开发语言:C#
更新时间:2021-03-27
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559

本次赞助数额为: 6 元 
   源码介绍


using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading.Tasks;

namespace WebApplication2.FaceAI
{
    public class FaceAttr
    {
        [DllImport("BaiduFaceApi.dll", EntryPoint = "face_attr", CharSet = CharSet.Ansi
           , CallingConvention = CallingConvention.Cdecl)]
        private static extern IntPtr face_attr(string file_name);
        [DllImport("BaiduFaceApi.dll", EntryPoint = "face_attr_by_buf", CharSet = CharSet.Ansi
            , CallingConvention = CallingConvention.Cdecl)]
        private static extern IntPtr face_attr_by_buf(byte[] buf, int size);
        [DllImport("BaiduFaceApi.dll", EntryPoint = "face_attr_by_mat", CharSet = CharSet.Ansi
            , CallingConvention = CallingConvention.Cdecl)]
        private static extern IntPtr face_attr_by_mat(IntPtr mat);
        [DllImport("BaiduFaceApi.dll", EntryPoint = "face_attr_by_face", CharSet = CharSet.Ansi
            , CallingConvention = CallingConvention.Cdecl)]
        public static extern IntPtr face_attr_by_face(IntPtr mat, ref TrackFaceInfo info);
        public string test_get_face_attr()
        {
            // 传入图片文件绝对路径
            IntPtr ptr = face_attr("d:\\2.jpg");
            string buf = Marshal.PtrToStringAnsi(ptr);
            return buf;
        }
    }
}