Skip to content

Commit

Permalink
Add timer
Browse files Browse the repository at this point in the history
  • Loading branch information
BobLd committed Jul 17, 2021
1 parent abd33a2 commit 65674c3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions YOLOv4MLNet/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Microsoft.ML;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using YOLOv4MLNet.DataStructures;
Expand Down Expand Up @@ -59,8 +61,9 @@ static void Main()

// save model
//mlContext.Model.Save(model, predictionEngine.OutputSchema, Path.ChangeExtension(modelPath, "zip"));

foreach (string imageName in new string[] { "kite.jpg", "kite_416.jpg", "dog_cat.jpg", "cars road.jpg", "ski.jpg", "ski2.jpg" })
var sw = new Stopwatch();
sw.Start();
foreach (string imageName in new string[] { "kite.jpg", "dog_cat.jpg", "cars road.jpg", "ski.jpg", "ski2.jpg" })
{
using (var bitmap = new Bitmap(Image.FromFile(Path.Combine(imageFolder, imageName))))
{
Expand Down Expand Up @@ -90,6 +93,8 @@ static void Main()
}
}
}
sw.Stop();
Console.WriteLine($"Done in {sw.ElapsedMilliseconds}ms.");
}
}
}

0 comments on commit 65674c3

Please sign in to comment.