Example #1
0
        public static void baiduAiInit()
        {
            object appid     = Conf.getConfig("global.config", "baiduappid");
            object apikey    = Conf.getConfig("global.config", "baiduapikey");
            object secretkey = Conf.getConfig("global.config", "baidusecretkey");

            if (appid == null)
            {
                appid = "";
            }
            if (apikey == null)
            {
                apikey = "";
            }
            if (secretkey == null)
            {
                secretkey = "";
            }
            Log.addLog("appid=" + appid);
            Log.addLog("apikey=" + apikey);
            Log.addLog("secretkey=" + secretkey);



            var APP_ID     = appid.ToString();
            var API_KEY    = apikey.ToString();
            var SECRET_KEY = secretkey.ToString();

            Conf.ap = ap = new AntiPorn(API_KEY, SECRET_KEY);
            Conf.ic = new ImageCensor(API_KEY, SECRET_KEY);
            Log.addLog("初始化百度AI完成");
        }
Example #2
0
        public JObject ImageUserDefined(byte[] bytes)
        {
            var client = new ImageCensor(API_KEY, SECRET_KEY);

            client.Timeout = 60000; // 修改超时时间

            var ret = client.UserDefined(bytes);

            return(ret);
        }