From e65bd1d46291e53685c02e0f0609b323535b57d4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 4 Jan 2023 23:33:51 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/source/links.rst | 2 +- src/torchmetrics/functional/image/__init__.py | 4 ++-- src/torchmetrics/functional/image/psnrb.py | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/source/links.rst b/docs/source/links.rst index 726c14acc13..ab36beedbfd 100644 --- a/docs/source/links.rst +++ b/docs/source/links.rst @@ -116,4 +116,4 @@ .. _Signal-to-noise ratio: https://arxiv.org/abs/1811.02508 .. _Permutation invariant training: https://arxiv.org/abs/1607.00325 .. _Multilabel coverage error: https://link.springer.com/chapter/10.1007/978-0-387-09823-4_34 -.. _Peak Signal to Noise Ratio With Blocked Effect: https://ieeexplore.ieee.org/abstract/document/5535179 \ No newline at end of file +.. _Peak Signal to Noise Ratio With Blocked Effect: https://ieeexplore.ieee.org/abstract/document/5535179 diff --git a/src/torchmetrics/functional/image/__init__.py b/src/torchmetrics/functional/image/__init__.py index 3b7bc8eaf0f..a6e19c6a686 100644 --- a/src/torchmetrics/functional/image/__init__.py +++ b/src/torchmetrics/functional/image/__init__.py @@ -14,7 +14,8 @@ from torchmetrics.functional.image.d_lambda import spectral_distortion_index # noqa: F401 from torchmetrics.functional.image.ergas import error_relative_global_dimensionless_synthesis # noqa: F401 from torchmetrics.functional.image.gradients import image_gradients # noqa: F401 -from torchmetrics.functional.image.psnr import peak_signal_noise_ratio # noqa: F401 +from torchmetrics.functional.image.psnr import peak_signal_noise_ratio +from torchmetrics.functional.image.psnrb import peak_signal_noise_ratio # noqa: F401 from torchmetrics.functional.image.sam import spectral_angle_mapper # noqa: F401 from torchmetrics.functional.image.ssim import ( # noqa: F401 multiscale_structural_similarity_index_measure, @@ -22,4 +23,3 @@ ) from torchmetrics.functional.image.tv import total_variation # noqa: F401 from torchmetrics.functional.image.uqi import universal_image_quality_index # noqa: F401 -from torchmetrics.functional.image.psnrb import peak_signal_noise_ratio # noqa: F401 \ No newline at end of file diff --git a/src/torchmetrics/functional/image/psnrb.py b/src/torchmetrics/functional/image/psnrb.py index e3e53291e3a..a921fb7a6ed 100644 --- a/src/torchmetrics/functional/image/psnrb.py +++ b/src/torchmetrics/functional/image/psnrb.py @@ -61,7 +61,6 @@ def _compute_bef( diff = torch.gather(0, v_bc.unsqueeze(0)) - torch.gather(0, v_b.unsqueeze(0)) d_bc += torch.sum(torch.square(diff)) - # N code n_hb = height * (width / block_size) - 1 n_hbc = (height * (width - 1)) - n_hb