π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
fix(benchmarks): mirror border for the scikit-image median reference (#5811)
Dmytro Mishkin8acab7a2a701
diff --git a/benchmarks/filters/flagship.py b/benchmarks/filters/flagship.pyindex 8578c3bad..7c7eba556 100644--- a/benchmarks/filters/flagship.py+++ b/benchmarks/filters/flagship.py@@ -54,9 +54,9 @@ grayscale internally per its definition; the OpenCV canny loop therefore includeThe Laplacian columns are different operators: Kornia uses an L1-normalized all-ones window withcenter ``1 - kernel_area``; OpenCV sums second Sobel derivatives and scikit-image's kernel differs-as well. Sobel normalization differs across libraries. Median uses zero padding in-Kornia/scikit-image and replicated borders in OpenCV. The scikit-image Gaussian uses ``mode='mirror'`` (the-SciPy mode matching PyTorch reflect padding) and ``truncate=2 / 1.5`` for a 5x5 support. Its rank+as well. Sobel normalization differs across libraries. Median uses mirror borders in Kornia (torch's ``reflect``)+and scikit-image (``mode='mirror'``), and replicated borders in OpenCV. The scikit-image Gaussian uses+``mode='mirror'`` (the SciPy mode matching PyTorch reflect padding) and ``truncate=2 / 1.5`` for a 5x5 support. Its rankmean is a uint8 footprint-based box filter with truncated boundary footprints. These arenative-regime throughput comparisons, not output-equivalent comparisons.@@ -360,9 +360,7 @@ def build_ops(else None)row["scikit-image"] = (- (lambda: [skf.median(im, footprint=footprint_5_hwc, mode="constant", cval=0) for im in imgs_f])- if skf- else None+ (lambda: [skf.median(im, footprint=footprint_5_hwc, mode="mirror") for im in imgs_f]) if skf else None)ops["median_blur"] = row