57e82c37bd1e40f9fb37b21719fda4ebadd095de,preparation.py,,overlay_contours,#Any#Any#Any#,49

Before Change


    for mask_dirname in tqdm(glob.glob("{}/*/masks".format(train_dir))):
        masks = []
        for image_filepath in glob.glob("{}/*".format(mask_dirname)):
            image = plt.imread(image_filepath)
            masks.append(get_contour(image))
        overlayed_masks = np.where(np.sum(masks, axis=0) > 128., 255., 0.).astype(np.uint8)

        target_filepath = "/".join(mask_dirname.replace(images_dir, target_dir).split("/")[:-1]) + ".png"

After Change


    for mask_dirname in tqdm(glob.glob("{}/*/masks".format(train_dir))):
        masks = []
        for image_filepath in glob.glob("{}/*".format(mask_dirname)):
            image = np.asarray(Image.open(image_filepath))
            image = image / image.max(axis=None).astype(np.float32)
            masks.append(get_contour(image))
        overlayed_masks = np.where(np.sum(masks, axis=0) > 128., 255., 0.).astype(np.uint8)
        target_filepath = "/".join(mask_dirname.replace(images_dir, target_dir).split("/")[:-1]) + ".png"
        os.makedirs(os.path.dirname(target_filepath), exist_ok=True)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 12

Instances


Project Name: minerva-ml/open-solution-data-science-bowl-2018
Commit Name: 57e82c37bd1e40f9fb37b21719fda4ebadd095de
Time: 2018-02-16
Author: kamil.kaczmarek@codilime.com
File Name: preparation.py
Class Name:
Method Name: overlay_contours


Project Name: minerva-ml/open-solution-data-science-bowl-2018
Commit Name: 57e82c37bd1e40f9fb37b21719fda4ebadd095de
Time: 2018-02-16
Author: kamil.kaczmarek@codilime.com
File Name: preparation.py
Class Name:
Method Name: overlay_centers


Project Name: minerva-ml/open-solution-data-science-bowl-2018
Commit Name: 57e82c37bd1e40f9fb37b21719fda4ebadd095de
Time: 2018-02-16
Author: kamil.kaczmarek@codilime.com
File Name: utils.py
Class Name:
Method Name: read_masks


Project Name: minerva-ml/open-solution-data-science-bowl-2018
Commit Name: 57e82c37bd1e40f9fb37b21719fda4ebadd095de
Time: 2018-02-16
Author: kamil.kaczmarek@codilime.com
File Name: preparation.py
Class Name:
Method Name: overlay_contours