Skip to content

Please note the Resize, Crop usage of torchvision.transforms! #67

@kmkmkr

Description

@kmkmkr

Differences between Resize and Crop arguments may cause incorrect comparisons between corruption data and clean data.

The label of this image is tench, in the case of this image, method 1 clearly improves the accuracy of the original (severity=0)
In the transformation of the original image, method1 is incorrect

For a correct comparison, I would suggest using method2 .

clean_image_path : val/n01440764/ILSVRC2012_val_00041939.JPEG.png
method1

transforms.Resize((256, 256)),
transforms.CenterCrop((224, 224)),

method2

transforms.Resize(256),
transforms.CenterCrop(224),

method1 result (severity:0->1->2->3->4->5)
Screenshot from 2024-06-21 14-17-41

method2 result(severity:0->1->2->3->4->5)
Screenshot from 2024-06-21 14-18-19

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