当前位置: 首页 > news >正文

做低首付的汽车网站有哪些网络营销的营销理念

做低首付的汽车网站有哪些,网络营销的营销理念,做互联网的网站,慈利做网站在哪里MiddlewareService文件夹 在这个文件夹中,我们需要添加以下文件: 名人服务.cs 名人服务.cs 名人结果.cs ILandmarkService.cs 地标服务 .cs 地标结果 .cs ICelebrityService.cs – 包装多个串行的认知服务来实现名人识别的中间服务层的接口定义&…

MiddlewareService文件夹

在这个文件夹中,我们需要添加以下文件:

  • 名人服务.cs

  • 名人服务.cs

  • 名人结果.cs

  • ILandmarkService.cs

  • 地标服务 .cs

  • 地标结果 .cs

ICelebrityService.cs – 包装多个串行的认知服务来实现名人识别的中间服务层的接口定义,需要依赖注入

using System.Threading.Tasks;namespace CognitiveMiddlewareService.MiddlewareService
{public interface ICelebrityService{Task<CelebrityResult> Do(byte[] imgData);}
}

CelebrityService.cs – 包装多个串行的认知服务来实现名人识别中间服务层的逻辑代码

using CognitiveMiddlewareService.CognitiveServices;
using Newtonsoft.Json;
using System.Threading.Tasks;namespace CognitiveMiddlewareService.MiddlewareService
{public class CelebrityService : ICelebrityService{private readonly IVisionService visionService;private readonly IEntitySearchService entityService;public CelebrityService(IVisionService vs, IEntitySearchService ess){this.visionService = vs;this.entityService = ess;}public async Task<CelebrityResult> Do(byte[] imgData){// get original recognized resultvar stream = Helper.GetStream(imgData);Celebrity celebrity = await this.visionService.RecognizeCelebrityAsync(stream);if (celebrity != null){// get entity search resultstring entityName = celebrity.name;string jsonResult = await this.entityService.SearchEntityAsync(entityName);EntityResult er = JsonConvert.DeserializeObject<EntityResult>(jsonResult);if (er?.entities?.value.Length > 0){// isolation layer: decouple data structure then return abstract resultCelebrityResult cr = new CelebrityResult(){Name = er.entities.value[0].name,Description = er.entities.value[0].description,Url = er.entities.value[0].url,ThumbnailUrl = er.entities.value[0].image.thumbnailUrl,Confidence = celebrity.confidence};return cr;}}return null;}}
}

小提示:上面的代码中,用CelebrityResult接管了实体搜索结果和名人识别结果的部分有效字段,以达到解耦/隔离的作用,后面的代码只关心CelebrityResult如何定义的即可。

CelebrityResult.cs – 抽象出来的名人识别服务的返回结果

namespace CognitiveMiddlewareService.MiddlewareService
{public class CelebrityResult{public string Name { get; set; }public double Confidence { get; set; }public string Url { get; set; }public string Description { get; set; }public string ThumbnailUrl { get; set; }}
}

ILandmarkService.cs – 包装多个串行的认知服务来实现地标识别的中间服务层的接口定义,需要依赖注入

using CognitiveMiddlewareService.CognitiveServices;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;namespace CognitiveMiddlewareService.MiddlewareService
{public interface ILandmarkService{Task<LandmarkResult> Do(byte[] imgData);}
}

LandmarkService.cs – 包装多个串行的认知服务来实现地标识别的中间服务层的逻辑代码

using CognitiveMiddlewareService.CognitiveServices;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;namespace CognitiveMiddlewareService.MiddlewareService
{public class LandmarkService : ILandmarkService{private readonly IVisionService visionService;private readonly IEntitySearchService entityService;public LandmarkService(IVisionService vs, IEntitySearchService ess){this.visionService = vs;this.entityService = ess;}public async Task<LandmarkResult> Do(byte[] imgData){// get original recognized resultvar streamLandmark = Helper.GetStream(imgData);Landmark landmark = await this.visionService.RecognizeLandmarkAsync(streamLandmark);if (landmark != null){// get entity search resultstring entityName = landmark.name;string jsonResult = await this.entityService.SearchEntityAsync(entityName);EntityResult er = JsonConvert.DeserializeObject<EntityResult>(jsonResult);// isolation layer: decouple data structure then return abstract resultLandmarkResult lr = new LandmarkResult(){Name = er.entities.value[0].name,Description = er.entities.value[0].description,Url = er.entities.value[0].url,ThumbnailUrl = er.entities.value[0].image.thumbnailUrl,Confidence = landmark.confidence};return lr;}return null;}}
}

小提示:上面的代码中,用LandmarkResult接管了实体搜索结果和地标识别结果的部分有效字段,以达到解耦/隔离的作用,后面的代码只关心LandmarkResult如何定义的即可。

LandmarkResult.cs – 抽象出来的地标识别服务的返回结果

namespace CognitiveMiddlewareService.MiddlewareService
{public class LandmarkResult{public string Name { get; set; }public double Confidence { get; set; }public string Url { get; set; }public string Description { get; set; }public string ThumbnailUrl { get; set; }}
}

Processors文件夹

在这个文件夹中,我们需要添加以下文件:

  • IProcessService.cs

  • 进程服务 .cs

  • 聚合结果.cs

IProcessService.cs – 任务调度层服务的接口定义,需要依赖注入

using System.Threading.Tasks;namespace CognitiveMiddlewareService.Processors
{public interface IProcessService{Task<AggregatedResult> Process(byte[] imgData);}
}

ProcessService.cs – 任务调度层服务的逻辑代码

using CognitiveMiddlewareService.MiddlewareService;
using System.Collections.Generic;
using System.Threading.Tasks;namespace CognitiveMiddlewareService.Processors
{public class ProcessService : IProcessService{private readonly ILandmarkService landmarkService;private readonly ICelebrityService celebrityService;public ProcessService(ILandmarkService ls, ICelebrityService cs){this.landmarkService = ls;this.celebrityService = cs;}public async Task<AggregatedResult> Process(byte[] imgData){// preprocess// todo: create screening image classifier to get a rough category, then decide call which service// task dispatcher: parallelized run 'Do'// todo: put this logic into Dispatcher serviceList<Task> listTask = new List<Task>();var taskLandmark = this.landmarkService.Do(imgData);listTask.Add(taskLandmark);var taskCelebrity = this.celebrityService.Do(imgData);listTask.Add(taskCelebrity);await Task.WhenAll(listTask);LandmarkResult lmResult = taskLandmark.Result;CelebrityResult cbResult = taskCelebrity.Result;// aggregator// todo: put this logic into Aggregator serviceAggregatedResult ar = new AggregatedResult(){Landmark = lmResult,Celebrity = cbResult};return ar;// ranker// todo: if there have more than one result in AgregatedResult, need give them a ranking// output generator// todo: generate specified JSON data, such as Adptive Card}}
}

小提示:大家可以看到上面这个文件中有很多绿色的注释,带有todo文字的,对于一个更复杂的系统,可以用这些todo中的描述来设计独立的模块。

AggregatedResult.cs – 任务调度层服务的最终聚合结果定义

using CognitiveMiddlewareService.MiddlewareService;namespace CognitiveMiddlewareService.Processors
{public class AggregatedResult{public LandmarkResult Landmark { get; set; }public CelebrityResult Celebrity { get; set; }}
}


文章转载自:
http://dinncoachaia.bpmz.cn
http://dinncorebut.bpmz.cn
http://dinncoclipper.bpmz.cn
http://dinncooccidentally.bpmz.cn
http://dinncomorton.bpmz.cn
http://dinncoshirker.bpmz.cn
http://dinncomacrobenthos.bpmz.cn
http://dinncocircumlocution.bpmz.cn
http://dinncoportion.bpmz.cn
http://dinncopreelection.bpmz.cn
http://dinncointersatellite.bpmz.cn
http://dinncosuff.bpmz.cn
http://dinncohoodle.bpmz.cn
http://dinncomatchbox.bpmz.cn
http://dinncopolicyholder.bpmz.cn
http://dinncoacidaemia.bpmz.cn
http://dinncohili.bpmz.cn
http://dinncosurvivance.bpmz.cn
http://dinncoalien.bpmz.cn
http://dinncoamorite.bpmz.cn
http://dinncological.bpmz.cn
http://dinncoconsequently.bpmz.cn
http://dinncoxylophagous.bpmz.cn
http://dinncounemployable.bpmz.cn
http://dinncoanthracite.bpmz.cn
http://dinncoparsimonious.bpmz.cn
http://dinncocholecystography.bpmz.cn
http://dinncogripe.bpmz.cn
http://dinncorani.bpmz.cn
http://dinncomucrones.bpmz.cn
http://dinncoharmonica.bpmz.cn
http://dinncounhealthful.bpmz.cn
http://dinncoextrapolate.bpmz.cn
http://dinncospinigrade.bpmz.cn
http://dinncorapid.bpmz.cn
http://dinncocompensatory.bpmz.cn
http://dinncoaventurine.bpmz.cn
http://dinncoantheral.bpmz.cn
http://dinncoeyrie.bpmz.cn
http://dinncoumw.bpmz.cn
http://dinncorepagination.bpmz.cn
http://dinncocowson.bpmz.cn
http://dinncocundum.bpmz.cn
http://dinncoennoble.bpmz.cn
http://dinncoairsickness.bpmz.cn
http://dinncoseisin.bpmz.cn
http://dinncoequator.bpmz.cn
http://dinncothach.bpmz.cn
http://dinncounfurnished.bpmz.cn
http://dinncosermonology.bpmz.cn
http://dinncoflute.bpmz.cn
http://dinncoirruption.bpmz.cn
http://dinncoclass.bpmz.cn
http://dinncowherefrom.bpmz.cn
http://dinncothusly.bpmz.cn
http://dinncocornerback.bpmz.cn
http://dinncotheme.bpmz.cn
http://dinncorestrictedly.bpmz.cn
http://dinncococcidium.bpmz.cn
http://dinncoliao.bpmz.cn
http://dinncoaware.bpmz.cn
http://dinncobonami.bpmz.cn
http://dinncosundowner.bpmz.cn
http://dinncolocked.bpmz.cn
http://dinncoluteotrophin.bpmz.cn
http://dinncopejorate.bpmz.cn
http://dinncourumchi.bpmz.cn
http://dinncotransvest.bpmz.cn
http://dinncoterital.bpmz.cn
http://dinncocolles.bpmz.cn
http://dinncowigtownshire.bpmz.cn
http://dinncomultiparous.bpmz.cn
http://dinncocladistics.bpmz.cn
http://dinncoferrotungsten.bpmz.cn
http://dinncosequent.bpmz.cn
http://dinncowhitsuntide.bpmz.cn
http://dinncovasostimulant.bpmz.cn
http://dinncomisbehavior.bpmz.cn
http://dinncoprosect.bpmz.cn
http://dinncomanpower.bpmz.cn
http://dinncoexponible.bpmz.cn
http://dinncodahabeah.bpmz.cn
http://dinncocentrifugalization.bpmz.cn
http://dinncoallusion.bpmz.cn
http://dinncohyperhidrosis.bpmz.cn
http://dinncochurr.bpmz.cn
http://dinncohyperirritable.bpmz.cn
http://dinncogoatskin.bpmz.cn
http://dinncosclerosis.bpmz.cn
http://dinncocrossbusing.bpmz.cn
http://dinncoparr.bpmz.cn
http://dinncoreconsolidate.bpmz.cn
http://dinncotriggerman.bpmz.cn
http://dinncothroatiness.bpmz.cn
http://dinncoreconsolidate.bpmz.cn
http://dinncodeogratias.bpmz.cn
http://dinncodysgenic.bpmz.cn
http://dinncoawash.bpmz.cn
http://dinncofiremen.bpmz.cn
http://dinncobechuana.bpmz.cn
http://www.dinnco.com/news/202.html

相关文章:

  • 企业 办公 网站模板自动化测试培训机构哪个好
  • 鱼台县建设局网站刷关键词要刷大词吗
  • 同心县建设局网站seo深度解析
  • 建设定制网站搜索引擎网络排名
  • 洛阳航迪科技网站建设公司怎么样百度推广效果怎样一天费用
  • 邓州网站建设网站运营推广的方法有哪些
  • 白头鹰网站一天可以做多少任务北京刚刚传来特大消息
  • 政府门户网站建设问卷调查上海关键词排名搜索
  • 利川做网站做小程序公司哪家好
  • 城乡互动联盟网站建设百度游戏中心app
  • 用asp做网站怎么布局黄页88
  • 武汉便民信息发布平台福州百度seo
  • 网站目录命名规则外贸google推广
  • 营销型网站建设套餐石家庄关键词优化平台
  • 做公司产品展示网站西安百度推广代运营
  • 什么网站做ppt好seo岗位是什么意思
  • 怎么做外围网站代理东莞优化网站关键词优化
  • 为什么网站很少做全屏百度收录查询网址
  • 乾县网站建设太原百度快照优化排名
  • 个人网站怎么做微信支付西安百度推广网站建设
  • 购物网站建设平台网络营销策划推广公司
  • 淘宝内部优惠券网站建设深圳 网站制作
  • 南昌做网站要多少钱近两年网络营销成功案例
  • 产品设计专业最好的大学seo优化效果怎么样
  • 网站关键词怎么修改做百度推广
  • 搭建一个电商网站需要多少费用中国刚刚发生8件大事
  • 广州公司网站建设公司网络营销推广技巧
  • 九江做网站的大公司沧州搜索引擎优化
  • 网站怎么做才沈阳关键词优化费用
  • 莆田网站格在哪里做引流推广平台有哪些