I am using Alturos.YOLO with Emgu CV 3.2 (World.dll) in a C# WPF Application. I am testing this app on an 8GB RAM. But, it is VERY slow. I don't know what seems to be the problem. Here is my code:
private void Timer_Tick(object sender, EventArgs e)
{
var img = capture.QueryFrame();
videoViewer.Source = ToBitmapSource(img);
var memoryStream = new MemoryStream();
img.Bitmap.Save(memoryStream, ImageFormat.Png);
var _items = yolo.Detect(memoryStream.ToArray()).ToList();
var graphics = Graphics.FromImage(img.Bitmap);
var brush = new SolidBrush(Color.LightGreen);
foreach (var item in _items)
{
var x = item.X;
var y = item.Y;
var width = item.Width;
var height = item.Height;
var type = item.Type; // class name of the object
var rect = new Rectangle(x, y, width, height);
var pen = new Pen(Color.LightGreen, 6);
var point = new System.Drawing.Point(x + width / 2, y + height / 2);
graphics.DrawRectangle(pen, rect);
graphics.DrawString($"{item.Type} : {item.Height} * {item.Width}", new Font("Arial", 23f), brush, point);
MessageBox.Show(type);
}
}