Skip to content

ESRGAN datasets.py problem #198

@lizhuoq

Description

@lizhuoq

In the denormalize function, the range for clamping the tensor should be between 0 and 1. This is because the input tensors to the function include one tensor processed by the ToTensor function and another tensor generated by the network. The valid value range for both of these tensors is between 0 and 1. Therefore, the denormalize function should be modified accordingl. Modify it as follows:

def denormalize(tensors):
    ''' channel in the second dim'''
    for c in range(3):
        tensors[:, c].mul_(std[c]).add_(mean[c]) # Underscores are in-place operations
    return torch.clamp(tensors, 0, 1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions