public void TestNonMaximumSuppression_NonOverlapping()
        {
            var observation1 = new Observation(_category, 0.9, new SKRect(0.1f, 0.2f, 0.3f, 0.4f));
            var observation2 = new Observation(_category, 0.78, new SKRect(0.4f, 0.5f, 0.5f, 0.6f));
            var observations = new[] { observation1, observation2 };

            var result = PostProcessingService.NonMaximumSuppression(observations, IOUThreshold, ConfidenceThreshold)
                         .ToList();

            AssertUtils.AreEqualIEnumerable(observations, result);
        }
        public void TestNonMaximumSuppression_IOUGreaterThanThreshold()
        {
            var observation1 = new Observation(_category, 0.78, new SKRect(1f, 1f, 7f, 7f));
            var observation2 = new Observation(_category, 0.9, new SKRect(0f, 0f, 6f, 6f));
            var observations = new[] { observation1, observation2 };

            var result = PostProcessingService.NonMaximumSuppression(observations, IOUThreshold, ConfidenceThreshold)
                         .ToList();

            AssertUtils.AreEqualIEnumerable(new[] { observation2 }, result);
        }
        public void TestNonMaximumSuppression_CompletelyOverlappingIOUEqualToThreshold()
        {
            var observation1 = new Observation(_category, 0.9, new SKRect(1f, 2f, 5f, 8f));
            var observation2 = new Observation(_category, 0.78, new SKRect(2f, 3f, 5f, 7f));
            var observations = new[] { observation1, observation2 };

            var result = PostProcessingService.NonMaximumSuppression(observations, IOUThreshold, ConfidenceThreshold)
                         .ToList();

            AssertUtils.AreEqualIEnumerable(observations, result);
        }