Skip to content

Commit

Permalink
Pylint failing
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeyiasemis committed Jun 24, 2024
1 parent 202dbaf commit 341ceb7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions direct/functionals/challenges.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# coding=utf-8
# Copyright (c) DIRECT Contributors

""" Direct metrics for the FastMRI and Calgary-Campinas challenges."""

import numpy as np
import torch

from skimage.metrics import structural_similarity, peak_signal_noise_ratio

__all__ = (
"fastmri_ssim",
"fastmri_psnr",
Expand All @@ -21,7 +25,6 @@ def _to_numpy(tensor):

def fastmri_ssim(gt, target):
"""Compute Structural Similarity Index Measure (SSIM) compatible with the FastMRI challenge."""
from skimage.metrics import structural_similarity

gt = _to_numpy(gt)[:, 0, ...]
target = _to_numpy(target)[:, 0, ...]
Expand Down Expand Up @@ -70,14 +73,10 @@ def _calgary_campinas_metric(gt, pred, metric_func):


def calgary_campinas_ssim(gt, pred):
from skimage.metrics import structural_similarity

return _calgary_campinas_metric(gt, pred, structural_similarity)


def calgary_campinas_psnr(gt, pred):
from skimage.metrics import peak_signal_noise_ratio

return _calgary_campinas_metric(gt, pred, peak_signal_noise_ratio)


Expand Down

0 comments on commit 341ceb7

Please sign in to comment.