<jupyter_start><jupyter_text>Super resolution eval<jupyter_code>model = geffnet.mobilenetv3_rw
model = geffnet.mobilenetv3_small_minimal_100
loss_func = lpips_loss()

bs=1
sz=1024

path_lowRes_512 = path/'DIV2K_train_LR_512_QF20'

data_gen = get_DIV2k_data_QF(path_lowRes_512, path_fullRes, bs=bs, sz=sz)

learn_gen = gen_learner_wide(data=data_gen,
                             gen_loss=loss_func,
                             arch = model,
                             nf_factor=2)
learn_gen.metrics.append(SSIM_Metric_gen())
learn_gen.metrics.append(SSIM_Metric_input())
learn_gen.metrics.append(LPIPS_Metric_gen())
learn_gen.metrics.append(BRISQUE_Metric_gen())
learn_gen.metrics.append(BRISQUE_Metric_input())
learn_gen.metrics.append(BRISQUE_Metric_target())
learn_gen.metrics.append(NIQE_Metric_gen())
learn_gen.metrics.append(NIQE_Metric_input())
learn_gen.metrics.append(NIQE_Metric_target())
weights = "/data/students_home/fmameli/repos/Artifact_Removal_GAN/models/unet_wideNf2_mobileV3_DivFlickr1k_P64px_SuperRes_gen_3"
learn_gen.load(weights, with_opt=False)
val = learn_gen.validate()
for name, m in zip(learn_gen.metrics, val[1:]):
    if isinstance(m, torch.Tensor):
        print(name, m.item())
    else:
        print(name, m)
model = geffnet.mobilenetv3_small_minimal_100

learn_gen = gen_learner_wide(data=data_gen,
                             gen_loss=loss_func,
                             arch = model,
                             nf_factor=2)

weights = "/data/students_home/fmameli/repos/Artifact_Removal_GAN/models/unet_wideNf2_mobileMin_DivFlickr1k_P64px_SuperRes_gen_3"
learn_gen.load(weights, with_opt=False)
val = learn_gen.validate()
for name, m in zip(learn_gen.metrics, val[1:]):
    if isinstance(m, torch.Tensor):
        print(name, m.item())
    else:
        print(name, m)<jupyter_output>SSIM_Metric_gen 0.5830532312393188
SSIM_Metric_input 0.5582197308540344
LPIPS_Metric_gen 0.34275034070014954
BRISQUE_Metric_gen 102.2244990084559
BRISQUE_Metric_input 103.40584471476105
BRISQUE_Metric_target 92.06918622940726
NIQE_Metric_gen 18.386282
NIQE_Metric_input 19.16361
NIQE_Metric_target 15.31811<jupyter_text>MSE<jupyter_code>model = geffnet.mobilenetv3_rw

learn_gen = gen_learner_wide(data=data_gen,
                             gen_loss=loss_func,
                             arch = model,
                             nf_factor=2)

weights = "/data/students_home/fmameli/repos/Artifact_Removal_GAN/models/unet_superRes_mobilenetV3_MSE_gen_512px_2"
learn_gen.load(weights, with_opt=False)

learn_gen.metrics.append(SSIM_Metric_gen())
learn_gen.metrics.append(SSIM_Metric_input())
learn_gen.metrics.append(LPIPS_Metric_gen())
learn_gen.metrics.append(BRISQUE_Metric_gen())
learn_gen.metrics.append(BRISQUE_Metric_input())
learn_gen.metrics.append(BRISQUE_Metric_target())
learn_gen.metrics.append(NIQE_Metric_gen())
learn_gen.metrics.append(NIQE_Metric_input())
learn_gen.metrics.append(NIQE_Metric_target())
val = learn_gen.validate()
for name, m in zip(learn_gen.metrics, val[1:]):
    if isinstance(m, torch.Tensor):
        print(name, m.item())
    else:
        print(name, m)<jupyter_output>SSIM_Metric_gen 0.5680757164955139
SSIM_Metric_input 0.5582197308540344
LPIPS_Metric_gen 0.41735437512397766
BRISQUE_Metric_gen 103.1188594359636
BRISQUE_Metric_input 103.40584471476105
BRISQUE_Metric_target 92.06918622940726
NIQE_Metric_gen 18.479246
NIQE_Metric_input 19.16361
NIQE_Metric_target 15.31811<jupyter_text>SSIM<jupyter_code>weights = "/data/students_home/fmameli/repos/Artifact_Removal_GAN/models/unet_superRes_mobilenetV3_SSIM_gen_512px_0"
learn_gen.load(weights, with_opt=False)
val = learn_gen.validate()
for name, m in zip(learn_gen.metrics, val[1:]):
    if isinstance(m, torch.Tensor):
        print(name, m.item())
    else:
        print(name, m)<jupyter_output>SSIM_Metric_gen 0.5877182483673096
SSIM_Metric_input 0.5582197308540344
LPIPS_Metric_gen 0.4079550802707672
BRISQUE_Metric_gen 100.28882333915725
BRISQUE_Metric_input 103.40584471476105
BRISQUE_Metric_target 92.06918622940726
NIQE_Metric_gen 18.223585
NIQE_Metric_input 19.16361
NIQE_Metric_target 15.31811
{'fraction_non_alphanumeric': 0.09244917715392062, 'fraction_numerical': 0.10285575992255566, 'mean_word_length': 4.998548621190131, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '286935', 'license': 'MIT', 'n_tokens_mistral': 1859, 'n_tokens_neox': 1566, 'n_words': 186, 'path': 'Super_Resolution_Evaluation.ipynb', 'repo_name': 'goldenbili/ARTIFACT_TEST', 'size': '4132'}