Skip to content

Commit

Permalink
tests for metrics and re order test locations
Browse files Browse the repository at this point in the history
  • Loading branch information
mattclifford1 committed Oct 8, 2024
1 parent 6780de0 commit c6b6194
Show file tree
Hide file tree
Showing 21 changed files with 606 additions and 557 deletions.
2 changes: 1 addition & 1 deletion IQM_Vis/UI/experiment_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def get_all_images(self):
self.ref_image_unprocessed = self.data_store.get_reference_unprocessed()
# get MSE for experiments to get a rough sorting
mses = []
mse = IQM_Vis.IQMs.MSE()
mse = IQM_Vis.metrics.MSE()
for trans in self.experiment_trans_params:
mses.append(
mse(self.ref_image, self.get_single_transform_im(trans)))
Expand Down
2 changes: 1 addition & 1 deletion IQM_Vis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from IQM_Vis.ui_wrapper import make_UI
from IQM_Vis.data_handlers.data_api import dataset_holder
from IQM_Vis.transforms import *
from IQM_Vis.metrics import IQMs
from IQM_Vis.metrics import *
from IQM_Vis import examples
from IQM_Vis import utils
from IQM_Vis.version import __version__
Expand Down
10 changes: 5 additions & 5 deletions IQM_Vis/examples/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

def run():
# metrics functions must return a single value
metric = {'MAE': IQM_Vis.IQMs.MAE(),
'MSE': IQM_Vis.IQMs.MSE(),
'1-SSIM': IQM_Vis.IQMs.SSIM()
metric = {'MAE': IQM_Vis.metrics.MAE(),
'MSE': IQM_Vis.metrics.MSE(),
'1-SSIM': IQM_Vis.metrics.SSIM()
}

# metrics images return a numpy image
metric_images = {
# 'MSE': IQM_Vis.IQMs.MSE(return_image=True),
# 'SSIM': IQM_Vis.IQMs.SSIM(return_image=True)
# 'MSE': IQM_Vis.metrics.MSE(return_image=True),
# 'SSIM': IQM_Vis.metrics.SSIM(return_image=True)
}

# make dataset list of images
Expand Down
12 changes: 6 additions & 6 deletions IQM_Vis/examples/dists.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ def correct(img, meta_dict, greycale=True):

def run():
# metrics functions must return a single value
metric = {'DISTS': IQM_Vis.IQMs.DISTS(),
'LPIPS': IQM_Vis.IQMs.LPIPS(),
'1-SSIM': IQM_Vis.IQMs.SSIM(),
'MAE': IQM_Vis.IQMs.MAE(),
# '1-MS_SSIM': IQM_Vis.IQMs.MS_SSIM(),
# 'NLPD': IQM_Vis.IQMs.NLPD(),
metric = {'DISTS': IQM_Vis.metrics.DISTS(),
'LPIPS': IQM_Vis.metrics.LPIPS(),
'1-SSIM': IQM_Vis.metrics.SSIM(),
'MAE': IQM_Vis.metrics.MAE(),
# '1-MS_SSIM': IQM_Vis.metrics.MS_SSIM(),
# 'NLPD': IQM_Vis.metrics.NLPD(),
}

# metrics images return a numpy image - dont include any for this example
Expand Down
12 changes: 6 additions & 6 deletions IQM_Vis/examples/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

def run():
# metrics functions must return a single value
metric = {'DISTS': IQM_Vis.IQMs.DISTS(),
'MAE': IQM_Vis.IQMs.MAE(),
'1-SSIM': IQM_Vis.IQMs.SSIM(),
# '1-MS_SSIM': IQM_Vis.IQMs.MS_SSIM(),
'NLPD': IQM_Vis.IQMs.NLPD(),
# 'LPIPS': IQM_Vis.IQMs.LPIPS(),
metric = {'DISTS': IQM_Vis.metrics.DISTS(),
'MAE': IQM_Vis.metrics.MAE(),
'1-SSIM': IQM_Vis.metrics.SSIM(),
# '1-MS_SSIM': IQM_Vis.metrics.MS_SSIM(),
'NLPD': IQM_Vis.metrics.NLPD(),
# 'LPIPS': IQM_Vis.metrics.LPIPS(),
}

# metrics images return a numpy image
Expand Down
10 changes: 5 additions & 5 deletions IQM_Vis/examples/multiple.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ def run():
file_path = os.path.dirname(os.path.abspath(__file__))

# metrics functions must return a single value
metric = {'MAE': IQM_Vis.IQMs.MAE(),
'MSE': IQM_Vis.IQMs.MSE(),
'1-SSIM': IQM_Vis.IQMs.SSIM()}
metric = {'MAE': IQM_Vis.metrics.MAE(),
'MSE': IQM_Vis.metrics.MSE(),
'1-SSIM': IQM_Vis.metrics.SSIM()}

# metrics images return a numpy image
metric_images = {'MSE': IQM_Vis.IQMs.MSE(return_image=True),
'SSIM': IQM_Vis.IQMs.SSIM(return_image=True)}
metric_images = {'MSE': IQM_Vis.metrics.MSE(return_image=True),
'SSIM': IQM_Vis.metrics.SSIM(return_image=True)}

# first row of images
row_1 = IQM_Vis.dataset_holder([os.path.join(file_path, 'images', 'waves2.jpeg')],
Expand Down
Loading

0 comments on commit c6b6194

Please sign in to comment.