/// <summary> /// 通用物体和场景识别并判断是否包括指定 keyword /// </summary> /// <param name="token">调用鉴权接口获取的token</param> /// <param name="localFilePath">本地图片路径</param> /// <param name="keyword">关键字</param> /// <returns></returns> public static bool advancedGeneral(string token, string localFilePath, string keyword) { var charArray = keyword.ToArray(); var advancedGeneralResult = AdvancedGeneral.advancedGeneral(token, localFilePath); return(advancedGeneralResult.result.Any(x => { return x.keyword.ToArray().Intersect(charArray).Any() || x.root.ToArray().Intersect(charArray).Any(); })); }
public void Test() { //去配置文档读取配置 BaiduConfig baiduConfig = new BaiduConfig() { ApiKey = "GFGZBfK9NzXe7DxZKl9A2Mb3", SecretKey = "qmsRizCCGVr6iiaBqITZuMrjLF3tYhMk" }; var token = AccessToken.getAccessToken(baiduConfig); var advancedGeneralResult = AdvancedGeneral.advancedGeneral(token.access_token, "f:\\files\\hcp.png"); }