Fayeben / GenerativeDiffusionPrior

Generative Diffusion Prior for Unified Image Restoration and Enhancement (CVPR2023)
Apache License 2.0
276 stars 30 forks source link

How can I perform testing on other datasets #2

Closed andytoo952 closed 1 year ago

andytoo952 commented 1 year ago

How can I perform testing on other datasets, such as the LOL dataset, and obtain the desired results? What should the corresponding npz format look like? Thank you for your assistance.

Fayeben commented 1 year ago

Hi, you can modify this imagenet_dataloader/save_random_images_hdr.py to obtain the .npz files.

andytoo952 commented 1 year ago

Thanks for your help!

jiachen0212 commented 5 months ago

Hi, you can modify this imagenet_dataloader/save_random_images_hdr.py to obtain the .npz files.

I use the save_random_images_hdr.py script to make an npz file of an LR image. Is it possible? Because the code seems to only save one img and label? ~

    imgs_high = []
    labels = []
    for i, (data, data2) in enumerate(zip(dataloader, dataloader2)):

        x, y = data
        x2, y2 = data2
        print(x2.shape)
        # imgs.append(x)
        imgs_high.append(x2)
        labels.append(y)

    # imgs = torch.cat(imgs, dim=0)
    imgs_high = torch.cat(imgs_high, dim=0)
    labels = torch.cat(labels, dim=0)

    file_name_high = ('hdr_100_long_resolution_%d' % image_size2)
    ......

   file_name_high_1 = ('hdr_100_long_resolution_%d.npz' % image_size2)
    np.savez(file_name_high_1, imgs_high, labels)