Ejemplo n.º 1
0
 public static IEnumerable <YoloItem> Convert(BboxContainer container, YoloObjectTypeResolver objectTypeResolver) => container.candidates.Where(o => o.h > 0 || o.w > 0)
 .Select(item => new YoloItem
 {
     X          = (int)item.x,
     Y          = (int)item.y,
     Height     = (int)item.h,
     Width      = (int)item.w,
     Confidence = item.prob,
     FrameId    = (int)item.frames_counter,
     TrackId    = (int)item.track_id,
     Shape      = (YoloItem.ShapeType)item.shape,
     Type       = objectTypeResolver.Resolve((int)item.obj_id)
 }).ToList();
Ejemplo n.º 2
0
 public YoloWrapper(string configurationFilename, string weightsFilename, string namesFilename, int gpu = 0)
 {
     objectTypeResolver = new YoloObjectTypeResolver(namesFilename);
     Initialize(configurationFilename, weightsFilename, gpu);
 }