Skip to content

Commit

Permalink
Updated demo
Browse files Browse the repository at this point in the history
  • Loading branch information
NickSwardh committed Oct 13, 2024
1 parent de632a7 commit 37e6886
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions ConsoleDemo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ static void RunDemo(ModelType modelType, ModelVersion modelVersion, ImageType im
using var yolo = new Yolo(new YoloOptions()
{
OnnxModel = modelPath,
ModelVersion = modelVersion,
Cuda = cuda,
PrimeGpu = primeGpu,
ModelType = modelType,
Expand Down Expand Up @@ -92,29 +91,29 @@ static void RunDemo(ModelType modelType, ModelVersion modelVersion, ImageType im
}
case ModelType.ObjectDetection:
{
var result = yolo.RunObjectDetection(image);
var result = yolo.RunObjectDetection(image, 0.23, 0.7);
labels = result.Select(x => x.Label).ToList();
resultImage = image.Draw(result);
break;
}
case ModelType.ObbDetection:
{
var result = yolo.RunObbDetection(image);
var result = yolo.RunObbDetection(image, 0.23, 0.7);
labels = result.Select(x => x.Label).ToList();
resultImage = image.Draw(result);
break;
}
case ModelType.Segmentation:
{
var result = yolo.RunSegmentation(image);
var result = yolo.RunSegmentation(image, 0.23, 0.65, 0.7);
labels = result.Select(x => x.Label).ToList();

resultImage = image.Draw(result);
break;
}
case ModelType.PoseEstimation:
{
var result = yolo.RunPoseEstimation(image);
var result = yolo.RunPoseEstimation(image, 0.23, 0.7);
labels = result.Select(x => x.Label).ToList();
resultImage = image.Draw(result, CustomKeyPointColorMap.KeyPointOptions);
break;
Expand Down Expand Up @@ -152,7 +151,6 @@ static void ObjectDetectionOnVideo()
{
OnnxModel = SharedConfig.GetTestModelV8(ModelType.ObjectDetection),
ModelType = ModelType.ObjectDetection,
ModelVersion = ModelVersion.V8,
Cuda = true
});

Expand Down

0 comments on commit 37e6886

Please sign in to comment.