3a25edce742db97d936ffb645185b520878d0c6d,dataset/resize.py,ImagenetResizer,resize_img,#ImagenetResizer#,23

Before Change


        width, height = img.size
        aspect_ratio = width / height
        if width <= height & width < size[0]:
            cover = img.resize((size[0], math.floor(size[0] / aspect_ratio)))
        elif width >= height & height < size[1]:
            cover = img.resize((size[1], math.floor(size[1] * aspect_ratio)))
        else:
            cover = resizeimage.resize_contain(img, size)

After Change


            // so take the side that"s closer in size and enlarge the image
            // in both directions to make that one fit
            factor = min(ratio_h, ratio_w)
            img = img.resize((int(width * factor), int(height * factor)))

        // Now we have an image that"s either larger than the desired shape
        // or at least one side matches the desired shape and we can resize
        // with contain
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: baldassarreFe/deep-koalarization
Commit Name: 3a25edce742db97d936ffb645185b520878d0c6d
Time: 2017-05-06
Author: baldassarre.fe@gmail.com
File Name: dataset/resize.py
Class Name: ImagenetResizer
Method Name: resize_img


Project Name: eriklindernoren/PyTorch-YOLOv3
Commit Name: b591a7aecce5b8de42a0dd7bba62780675d34fce
Time: 2019-04-30
Author: eriklindernoren@live.se
File Name: utils/datasets.py
Class Name: ImageFolder
Method Name: __getitem__


Project Name: utkuozbulak/pytorch-cnn-visualizations
Commit Name: 818b177b0d10394c1fd1c75465ff55aabadb221b
Time: 2018-12-30
Author: utku.ozbulak@gmail.com
File Name: src/gradcam.py
Class Name: GradCam
Method Name: generate_cam