public ObjectOverlayInfo(DetectedBrand entity) { //set fields Rect = new Rect(entity.Rectangle.X, entity.Rectangle.Y, entity.Rectangle.W, entity.Rectangle.H); var nameInfo = new ConfidenceInfo { Name = entity.Name, Confidence = entity.Confidence }; LabelsExt = new ConfidenceInfo[] { nameInfo }; EntityExt = new ImageCrop <ConfidenceInfo> { Entity = nameInfo }; }
public FaceOverlayInfo(FaceDescription entity, CelebritiesModel celebrity) { //set fields Rect = new Rect(entity.FaceRectangle.Left, entity.FaceRectangle.Top, entity.FaceRectangle.Width, entity.FaceRectangle.Height); var ageInfo = new AgeInfo { Age = entity.Age, Gender = entity.Gender != Gender.Female ? AgeInfoGender.Male : AgeInfoGender.Female }; AgeInfo celebrityInfo = null; if (celebrity != null) { ageInfo.Name = celebrity.Name; ageInfo.Confidence = celebrity.Confidence; celebrityInfo = ageInfo; } LabelsExt = new AgeInfo[] { ageInfo, celebrityInfo }; EntityExt = new ImageCrop <AgeInfo> { Entity = ageInfo }; IsCelebrity = celebrity != null; }