Example #1
0
        private void InitializeEngine(IConfiguration conf)
        {
            IConfiguration config = conf;

            _appID      = config["AppID"];
            _faceKey    = config["AppKey"];
            _engineNums = int.Parse(config["EngineNums"]);

            _enginePool = new Arcsoft_Face_Action(_appID, _faceKey);
            _enginePool.Arcsoft_EnginePool(_engineNums, 0, 0);
        }
        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
            //配置grpc
            services.AddGrpc();

            //添加虹软“引擎池”服务
            Arcsoft_Face_Action enginePool = new Arcsoft_Face_Action(appID, faceKey);

            enginePool.Arcsoft_EnginePool(faceEngineNums, 0, 0);
            services.AddArcSoftFaceService(enginePool);
        }