コード例 #1
0
        /// <summary>
        /// Get all landmarks for this picture
        /// </summary>
        /// <param name="imageFile">Picture base 64</param>
        /// <param name="extension">Extension picture</param>
        /// <returns>All landmarks with over 70% of prediction</returns>
        public async Task <List <StepValidation> > GetWhat(string imageFile, string extension, int idStep)
        {
            IReadOnlyList <EntityAnnotation> landsmarks = await clientGoogle.DetectLandmarksAsync(Image.FromBytes(ImageConverter.Base64ToByte(imageFile.Replace($"data:image/{extension};base64,", ""))));

            return(landsmarks.Where(l => l.Score * 100 >= 65).Select(l => new StepValidation {
                Id = 0, IdStep = idStep, Description = l.Description, Score = l.Score
            }).ToList());
        }