Skip to content

can not reproduce the result #1

Description

@ceo1207

i run this code to train a model twice, each time use 1w+ iterations.
But i can not reproduce the result of the paper. when i visualize the result, the result is terriable.

is there something wrong?
i just rescale and clip the result, but when i see the result, it just like a Color Inverted image. I try to change the order of the result, it does not work.

def show_img(img_data):
    img_data = np.squeeze(img_data)
    # img_data = img_data[:,:,::-1]
    img_data = img_data*255
    img_data = img_data.astype("int")
    img_data = np.clip(img_data, 0, 255)
    plt.imshow(img_data)
    plt.show()
def show_result(model, device):
    files_path  = "/home/ceo1207/Datasets/sr_test/Set5/"
    files = os.listdir(files_path)
    for item in files:
        img_array = np.asarray(Image.open(os.path.join(files_path, item)))
        plt.imshow(img_array)
        plt.show()
        img_array = img_array.transpose((2, 0, 1))
        img_array = img_array[np.newaxis, :, :, :]
        img_array = img_array.astype("float32") / 255.0
        x = torch.from_numpy(img_array).float()
        x = x.to(device)
        y_fake = model.gen_g(x)
        # y_fake.detach().cpu().numpy().transpose(0, 2, 3, 1)
        y_fake = y_fake.detach().cpu().numpy().transpose(0, 2, 3, 1)
        show_img(y_fake)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions