56926bc8b4a158e1c40cddbc795303bc6a66f44d,semantic-segmentation/deeplabv3plus/image_preprocess.py,,resize,#,28

Before Change


def resize(image, desired_size):

    old_size = image.shape[:2]  // old_size is in (height, width) format
    ratio = float(desired_size)/max(old_size)
    new_size = tuple([int(x*ratio) for x in old_size])

    // new_size should be in (width, height) format
    image = cv2.resize(image, (new_size[1], new_size[0]))

After Change



    old_size = image.shape[:2]  // old_size is in (height, width) format
    ratio = min(np.divide(desired_size, old_size))
    new_size = (int(old_size[0]*ratio), int(old_size[1]*ratio))

    // new_size should be in (width, height) format
    if image.shape[2] == 1:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: sony/nnabla-examples
Commit Name: 56926bc8b4a158e1c40cddbc795303bc6a66f44d
Time: 2019-05-23
Author: sukriti.mehrotra@sony.com
File Name: semantic-segmentation/deeplabv3plus/image_preprocess.py
Class Name:
Method Name: resize


Project Name: invesalius/invesalius3
Commit Name: 81b99bfa02345b83b75488a535a9bd85f49d65e6
Time: 2009-07-22
Author: paulojamorim@gmail.com
File Name: invesalius/data/imagedata_utils.py
Class Name:
Method Name: ResampleMatrix


Project Name: sony/nnabla-examples
Commit Name: 56926bc8b4a158e1c40cddbc795303bc6a66f44d
Time: 2019-05-23
Author: sukriti.mehrotra@sony.com
File Name: semantic-segmentation/deeplabv3plus/model_inference.py
Class Name:
Method Name: post_process