public async Task <(Image <Bgr, byte>, IReadOnlyCollection <DetectionResult>)> GetNextResultsAsync() { var image = await _ims.GetImageAsync(); //HACK: Fake implementation return(image, Enumerable.Empty <DetectionResult>().ToList().AsReadOnly()); }
public async Task <(Image <Bgr, byte>, IReadOnlyCollection <DetectionResult>)> GetNextResultsAsync() { var dr = Enumerable.Range(0, _rnd.Next(0, 10)).Select(_ => { var top = _rnd.Next(0, 500); var left = _rnd.Next(0, 700); return(new DetectionResult { Class = _rnd.Next(1, 5), Score = _rnd.Next(1, 100) / 100f, Box = new BBox(top, left, top + _rnd.Next(10, 100), left + _rnd.Next(10, 100)) }); }); var img = await _ims.GetImageAsync(); return(img, dr.ToList().AsReadOnly()); }