コード例 #1
0
ファイル: main.py プロジェクト: vincentcr/skdata
def main_show():
    """
    Use glumpy to launch a data set viewer.
    """
    self = CIFAR10()
    Y = [m["label"] for m in self.meta]
    glumpy_viewer(img_array=self._pixels, arrays_to_print=[Y], window_shape=(32 * 4, 32 * 4))
コード例 #2
0
ファイル: test_fg11.py プロジェクト: yamins81/eccv12
    def test_imgs():
        root = '/home/bergstra/cvs/eccv12/eccv12/tests/data/'
        saved_paths = np.load(os.path.join(root, 'fg11_Xraw0-4.npy'))
        saved_processed_imgs = np.load(os.path.join(root, 'fg11_X0-4.npy'))

        imgs = plugins.get_images('float32', None)

        print saved_paths
        print saved_processed_imgs.shape

        assert saved_processed_imgs[0].shape == imgs[0].shape

        # the saved_preprocessed_imgs were designed to include only images
        # that appeared in view1, so it is normal that some images are omitted.
        assert np.allclose(saved_processed_imgs[0], imgs[0])
        assert np.allclose(saved_processed_imgs[1], imgs[1])
        assert np.allclose(saved_processed_imgs[2], imgs[3])

        if 0:
            from skdata.utils.glviewer import glumpy_viewer, command, glumpy
            glumpy_viewer(
                    #img_array=saved_processed_imgs,
                    img_array=imgs,
                    arrays_to_print=[saved_paths],
                    cmap=glumpy.colormap.Grey)
コード例 #3
0
ファイル: main.py プロジェクト: AugustLONG/skdata
def main_show():
    """
    Use glumpy to launch a data set viewer.
    """
    self = KaggleFacialExpression()
    from skdata.utils.glviewer import glumpy_viewer

    glumpy_viewer(img_array=[m["pixels"] for m in self.meta], arrays_to_print=self.meta, window_shape=(48 * 4, 48 * 4))
コード例 #4
0
def show_centroids(D):
    D = D.copy()
    for di in D:
        di -= di.min()
        di /= di.max()
    glumpy_viewer(
            img_array=D.astype('float32'),
            arrays_to_print=[],
            )
コード例 #5
0
ファイル: main.py プロジェクト: pierreg/skdata
def main_show():
    """
    Use glumpy to launch a data set viewer.
    """
    self = CIFAR10()
    Y = [m['label'] for m in self.meta]
    glumpy_viewer(img_array=self._pixels,
                  arrays_to_print=[Y],
                  window_shape=(32 * 4, 32 * 4))
コード例 #6
0
ファイル: main.py プロジェクト: DailyActie/AI_DATA-skdata
def main_show():
    """
    Use glumpy to launch a data set viewer.
    """
    self = KaggleFacialExpression()
    from skdata.utils.glviewer import glumpy_viewer
    glumpy_viewer(img_array=[m['pixels'] for m in self.meta],
                  arrays_to_print=self.meta,
                  window_shape=(48 * 4, 48 * 4))
コード例 #7
0
def main_show():
    """
    Use glumpy to launch a data set viewer.
    """
    self = MNIST()
    Y = [m['label'] for m in self.meta]
    glumpy_viewer(img_array=self.arrays['train_images'],
                  arrays_to_print=[Y],
                  cmap=glumpy.colormap.Grey,
                  window_shape=(28 * 4, 28 * 4))
コード例 #8
0
ファイル: main.py プロジェクト: Afey/skdata
def main_show():
    """
    Use glumpy to launch a data set viewer.
    """
    from skdata.utils.glviewer import glumpy_viewer
    self = CIFAR10()
    Y = [m['label'] for m in self.meta]
    glumpy_viewer(
            img_array=self._pixels,
            arrays_to_print=[Y],
            window_shape=(32 * 4, 32 * 4))
コード例 #9
0
ファイル: main.py プロジェクト: Afey/skdata
def main_show():
    """
    Use glumpy to launch a data set viewer.
    """
    self = MNIST()
    Y = [m['label'] for m in self.meta]
    glumpy_viewer(
            img_array=self.arrays['train_images'],
            arrays_to_print=[Y],
            cmap=glumpy.colormap.Grey,
            window_shape=(28 * 4, 28 * 4)
            )
コード例 #10
0
def show():
    from skdata.utils.glviewer import glumpy_viewer
    vh = dataset.Calibrated(10)
    items = vh.meta[:10]
    images = np.asarray(map(vh.read_image, items))

    images = images.astype('float32')
    images /= images.reshape(10, 1024 * 1536).max(axis=1)[:, None, None]
    images = 1.0 - images

    glumpy_viewer(img_array=images,
                  arrays_to_print=[items],
                  window_shape=vh.meta[0]['image_shape'])
コード例 #11
0
ファイル: main.py プロジェクト: Afey/skdata
def show():
    from skdata.utils.glviewer import glumpy_viewer
    vh = dataset.Calibrated(10)
    items = vh.meta[:10]
    images = np.asarray(map(vh.read_image, items))

    images = images.astype('float32')
    images /= images.reshape(10, 1024 * 1536).max(axis=1)[:, None, None]
    images = 1.0 - images

    glumpy_viewer(
            img_array=images,
            arrays_to_print=[items],
            window_shape=vh.meta[0]['image_shape'])
コード例 #12
0
def show_patches():
    N = 100
    S = 128
    from skdata.utils.glviewer import glumpy_viewer
    vh = dataset.Calibrated(10)
    patches = vh.raw_patches((N, S, S), items=vh.meta[:10])

    patches = patches.astype('float32')
    patches /= patches.reshape(N, S * S).max(axis=1)[:, None, None]
    patches = 1.0 - patches

    SS = S
    while SS < 256:
        SS *= 2

    glumpy_viewer(img_array=patches,
                  arrays_to_print=[vh.meta],
                  window_shape=(SS, SS))
コード例 #13
0
ファイル: main.py プロジェクト: Afey/skdata
def show_patches():
    N = 100
    S = 128
    from skdata.utils.glviewer import glumpy_viewer
    vh = dataset.Calibrated(10)
    patches = vh.raw_patches((N, S, S), items=vh.meta[:10])

    patches = patches.astype('float32')
    patches /= patches.reshape(N, S * S).max(axis=1)[:, None, None]
    patches = 1.0 - patches


    SS = S
    while SS < 256:
        SS *= 2

    glumpy_viewer(
            img_array=patches,
            arrays_to_print=[vh.meta],
            window_shape=(SS, SS))
コード例 #14
0
ファイル: main.py プロジェクト: Afey/skdata
def main_show():
    """
    Use glumpy to launch a data set viewer.
    """
    variant = sys.argv[2]
    if variant == 'original':
        obj = view.Original()
        cmap=None
    elif variant == 'aligned':
        obj = view.Aligned()
        cmap=glumpy.colormap.Grey
    elif variant == 'funneled':
        obj = view.Funneled()
        cmap=None
    else:
        raise ValueError(variant)

    glumpy_viewer(
        img_array=obj.image_pixels,
        arrays_to_print=[obj.image_pixels],
        cmap=cmap,
        window_shape=(250, 250),
        )
コード例 #15
0
ファイル: main.py プロジェクト: DailyActie/AI_DATA-skdata
def main_show():
    """
    Use glumpy to launch a data set viewer.
    """
    variant = sys.argv[2]
    if variant == 'original':
        obj = view.Original()
        cmap = None
    elif variant == 'aligned':
        obj = view.Aligned()
        cmap = glumpy.colormap.Grey
    elif variant == 'funneled':
        obj = view.Funneled()
        cmap = None
    else:
        raise ValueError(variant)

    glumpy_viewer(
        img_array=obj.image_pixels,
        arrays_to_print=[obj.image_pixels],
        cmap=cmap,
        window_shape=(250, 250),
    )