Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
NickSwardh committed Oct 13, 2024
1 parent 9e2e1e1 commit 3b88b14
Show file tree
Hide file tree
Showing 17 changed files with 1 addition and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public void GlobalSetup()

// Yolov8
options.OnnxModel = _model8;
options.ModelVersion = ModelVersion.V8;

options.Cuda = false;
_cpuYolov8 = new Yolo(options);
Expand All @@ -43,7 +42,6 @@ public void GlobalSetup()

// Yolov11
options.OnnxModel = _model11;
options.ModelVersion = ModelVersion.V11;

options.Cuda = false;
_cpuYolov11 = new Yolo(options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,13 @@ public void GlobalSetup()

// Yolov8
options.OnnxModel = _modelV8;
options.ModelVersion = ModelVersion.V8;
_cpuYolov8 = new Yolo(options);

options.Cuda = true;
_gpuYolov8 = new Yolo(options);

// Yolov9
options.OnnxModel = _modelV9;
options.ModelVersion = ModelVersion.V9;
options.Cuda = false;

_cpuYolov9 = new Yolo(options);
Expand All @@ -54,7 +52,6 @@ public void GlobalSetup()

// Yolov10
options.OnnxModel = _modelV10;
options.ModelVersion = ModelVersion.V10;
options.Cuda = false;

_cpuYolov10 = new Yolo(options);
Expand All @@ -64,7 +61,6 @@ public void GlobalSetup()

// Yolov11
options.OnnxModel = _modelV11;
options.ModelVersion = ModelVersion.V11;
options.Cuda = false;

_cpuYolov11 = new Yolo(options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public void GlobalSetup()

// Yolov8
options.OnnxModel = _model8;
options.ModelVersion = ModelVersion.V8;

options.Cuda = false;
_cpuYolov8 = new Yolo(options);
Expand All @@ -43,7 +42,6 @@ public void GlobalSetup()

// Yolov11
options.OnnxModel = _model11;
options.ModelVersion = ModelVersion.V11;

options.Cuda = false;
_cpuYolov11 = new Yolo(options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public void GlobalSetup()

// Yolov8
options.OnnxModel = _model8;
options.ModelVersion = ModelVersion.V8;

options.Cuda = false;
_cpuYolov8 = new Yolo(options);
Expand All @@ -43,7 +42,6 @@ public void GlobalSetup()

// Yolov11
options.OnnxModel = _model11;
options.ModelVersion = ModelVersion.V11;

options.Cuda = false;
_cpuYolov11 = new Yolo(options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public void GlobalSetup()

// Yolov8
options.OnnxModel = _model8;
options.ModelVersion = ModelVersion.V8;

options.Cuda = false;
_cpuYolov8 = new Yolo(options);
Expand All @@ -43,7 +42,6 @@ public void GlobalSetup()

// Yolov11
options.OnnxModel = _model11;
options.ModelVersion = ModelVersion.V11;

options.Cuda = false;
_cpuYolov11 = new Yolo(options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public void RunClassification_Yolov11_LabelImageCorrectly_AssertTrue()
{
OnnxModel = model,
ModelType = ModelType.Classification,
ModelVersion = ModelVersion.V11,
Cuda = false
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public void RunClassification_Yolov8_LabelImageCorrectly_AssertTrue()
{
OnnxModel = model,
ModelType = ModelType.Classification,
ModelVersion = ModelVersion.V8,
Cuda = false
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public void RunObbDetection_Yolov11_GetExpectedNumberOfObjects_AssertTrue()
{
OnnxModel = model,
ModelType = ModelType.ObbDetection,
ModelVersion = ModelVersion.V11,
Cuda = false
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public void RunObbDetection_Yolov8_GetExpectedNumberOfObjects_AssertTrue()
{
OnnxModel = model,
ModelType = ModelType.ObbDetection,
ModelVersion = ModelVersion.V8,
Cuda = false
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public void RunObjectDetection_Yolov10_GetExpectedNumberOfObjects_AssertTrue()
{
OnnxModel = model,
ModelType = ModelType.ObjectDetection,
ModelVersion = ModelVersion.V10,
Cuda = false
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public void RunObjectDetection_Yolov11_GetExpectedNumberOfObjects_AssertTrue()
{
OnnxModel = model,
ModelType = ModelType.ObjectDetection,
ModelVersion = ModelVersion.V11,
Cuda = false
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public void RunObjectDetection_Yolov8_GetExpectedNumberOfObjects_AssertTrue()
{
OnnxModel = model,
ModelType = ModelType.ObjectDetection,
ModelVersion = ModelVersion.V8,
Cuda = false
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public void RunObjectDetection_Yolov9_GetExpectedNumberOfObjects_AssertTrue()
{
OnnxModel = model,
ModelType = ModelType.ObjectDetection,
ModelVersion = ModelVersion.V9,
Cuda = false
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public void RunPoseEstimation_Yolov11_GetExpectedNumberOfPoseEstimations_AssertT
{
OnnxModel = model,
ModelType = ModelType.PoseEstimation,
ModelVersion = ModelVersion.V11,
Cuda = false
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public void RunPoseEstimation_Yolov8_GetExpectedNumberOfPoseEstimations_AssertTr
{
OnnxModel = model,
ModelType = ModelType.PoseEstimation,
ModelVersion = ModelVersion.V8,
Cuda = false
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ public void RunSegmentation_Yolov11_GetExpectedNumberOfSegmentations_AssertTrue(
{
OnnxModel = model,
ModelType = ModelType.Segmentation,
ModelVersion = ModelVersion.V11,
Cuda = false
});

var image = SKImage.FromEncodedData(testImage);

// Act
var results = yolo.RunSegmentation(image, 0.25, 0.45);
var results = yolo.RunSegmentation(image, 0.25, 0.65, 0.45);

// Assert
Assert.Equal(17, results.Count);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public void RunSegmentation_Yolov8_GetExpectedNumberOfSegmentations_AssertTrue()
{
OnnxModel = model,
ModelType = ModelType.Segmentation,
ModelVersion = ModelVersion.V8,
Cuda = false
});

Expand Down

0 comments on commit 3b88b14

Please sign in to comment.