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

Before Change


        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)
        cover.save(join(self.dest_dir, filename), "JPEG")

After Change


            // Both sides of the image are shorter than the desired dimension,
            // 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: 7

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: baldassarreFe/deep-koalarization
Commit Name: 4af0d6b993453f2c8aec62c4ff7a8c0b1c877f22
Time: 2017-10-15
Author: baldassarre.fe@gmail.com
File Name: dataset/resize.py
Class Name: ImagenetResizer
Method Name: resize_img


Project Name: scikit-image/scikit-image
Commit Name: ed8539bc74d05675df666397be4902fa9cfb92a1
Time: 2017-09-20
Author: jsch@demuc.de
File Name: doc/examples/transform/plot_rescale.py
Class Name:
Method Name: