Esempio n. 1
0
    def import_data(self):
        images_original, images_segmented = self.extract_images(
            paths_original, paths_segmented)
        # Get a color palette
        # カラーパレットを取得
        image_sample_palette = Image.open(paths_segmented[0])
        palette = image_sample_palette.getpalette()

        return DataSet(images_original,
                       images_segmented,
                       palette,
                       augmenter=ia.ImageAugmenter(size=self.init_size,
                                                   class_count=len(
                                                       DataSet.CATEGORY)))
Esempio n. 2
0
    def import_data(dir_original, dir_segmented, init_size=None, one_hot=True):
        # Generate paths of images to load
        # 読み込むファイルのパスリストを作成
        paths_original, paths_segmented = Loader.generate_paths(dir_original, dir_segmented)

        # Extract images to ndarray using paths
        # 画像データをndarrayに展開
        images_original, images_segmented = Loader.extract_images(paths_original, paths_segmented, init_size, one_hot)

        # Get a color palette
        # カラーパレットを取得
        image_sample_palette = Image.open(paths_segmented[0])
        palette = image_sample_palette.getpalette()

        return DataSet(images_original, images_segmented, palette,
                       augmenter=ia.ImageAugmenter(size=init_size, class_count=len(DataSet.CATEGORY)))
Esempio n. 3
0
    def import_data(dir_original, dir_segmented, init_size=None, one_hot=True):
        # Generate paths of images to load
        paths_original, paths_segmented, filenames = Loader.generate_paths(
            dir_original, dir_segmented)

        # Extract images to ndarray using paths
        images_original, images_segmented = Loader.extract_images(
            paths_original, paths_segmented, init_size, one_hot)

        # Get a color palette
        image_sample_palette = Image.open(paths_segmented[0])
        palette = image_sample_palette.getpalette()

        return DataSet(images_original,
                       images_segmented,
                       palette,
                       augmenter=ia.ImageAugmenter(size=init_size,
                                                   class_count=len(
                                                       DataSet.CATEGORY)),
                       filenames=filenames)