private bool CheckSafeSearch(AnnotateImageResponse response) { var safeSearch = response.SafeSearchAnnotation; bool isAdult = safeSearch.Adult != Likelihood.VeryUnlikely && safeSearch.Adult != Likelihood.Unlikely; bool isViolent = safeSearch.Violence != Likelihood.VeryUnlikely && safeSearch.Violence != Likelihood.Unlikely; bool isRacy = safeSearch.Racy != Likelihood.VeryUnlikely && safeSearch.Racy != Likelihood.Unlikely; return(!(isAdult || isViolent || isRacy)); }
private bool CheckLogos(AnnotateImageResponse response, float minConfidence) { var list = response.LogoAnnotations.Where(x => x.Score >= minConfidence); return(list.Count() > 0); }
public string error; //a string providing information about errors. public MachineVisionResponse(bool isError, AnnotateImageResponse response) { this.isError = isError; this.annotateImageResponse = response; }