예제 #1
0
파일: lfw.py 프로젝트: zstone/scikits.data
    def main_show(cls):
        # Usage one of:
        # <driver> people
        # <driver> pairs
        from utils.glviewer import glumpy_viewer, command, glumpy
        import larray

        # print 'ARGV', sys.argv
        try:
            task = sys.argv[2]
        except IndexError:
            print >> sys.stderr, "Usage one of"
            print >> sys.stderr, "    <driver> lfw.<imgset> people"
            print >> sys.stderr, "    <driver> lfw.<imgset> pairs"
            print >> sys.stderr, "    <driver> lfw.<imgset> pairs_train"
            print >> sys.stderr, "    <driver> lfw.<imgset> pairs_test"
            print >> sys.stderr, "    <driver> lfw.<imgset> pairs_10folds"
            return 1

        if task == "people":
            self = cls()
            image_paths = [self.image_path(m) for m in self.meta]
            names = np.asarray([m["name"] for m in self.meta])
            glumpy_viewer(img_array=larray.lmap(utils.image.load_rgb_f32, image_paths), arrays_to_print=[names])
        elif task == "pairs" or sys.argv[2] == "pairs_train":
            raise NotImplementedError()
        elif task == "pairs_test":
            raise NotImplementedError()
        elif task == "pairs_10folds":
            fold_num = int(sys.argv[3])
            raise NotImplementedError()
        if 0:
            left_imgs = img_load(lpaths, slice_, color, resize)
            right_imgs = img_load(rpaths, slice_, color, resize)
            pairs = larray.lzip(left_imgs, right_imgs)
예제 #2
0
def show():
    Y = [m['label'] for m in self.meta]
    glumpy_viewer(
            img_array=CIFAR10._pixels,
            arrays_to_print=[Y],
            cmap=glumpy.colormap.Grey,
            window_shape=(32 * 2, 32 * 2))
예제 #3
0
    def main_show(cls):
        # Usage one of:
        # <driver> people
        # <driver> pairs
        from utils.glviewer import glumpy_viewer
        try:
            task = sys.argv[2]
        except IndexError:
            print >> sys.stderr, "Usage one of"
            print >> sys.stderr, "    <driver> lfw.<imgset> people"
            print >> sys.stderr, "    <driver> lfw.<imgset> pairs"
            print >> sys.stderr, "    <driver> lfw.<imgset> pairs_train"
            print >> sys.stderr, "    <driver> lfw.<imgset> pairs_test"
            print >> sys.stderr, "    <driver> lfw.<imgset> pairs_10folds"
            return 1

        if task == 'people':
            self = cls()
            image_paths = [self.image_path(m) for m in self.meta]
            names = np.asarray([m['name'] for m in self.meta])
            glumpy_viewer(
                    img_array=larray.lmap(
                        utils.image.load_rgb_f32,
                        image_paths),
                    arrays_to_print=[names])
        elif task == 'pairs' or sys.argv[2] == 'pairs_train':
            raise NotImplementedError()
        elif task == 'pairs_test':
            raise NotImplementedError()
        elif task == 'pairs_10folds':
            raise NotImplementedError()
예제 #4
0
    def main_show(cls):
        # Usage one of:
        # <driver> people
        # <driver> pairs
        from utils.glviewer import glumpy_viewer
        try:
            task = sys.argv[2]
        except IndexError:
            print >> sys.stderr, "Usage one of"
            print >> sys.stderr, "    <driver> lfw.<imgset> people"
            print >> sys.stderr, "    <driver> lfw.<imgset> pairs"
            print >> sys.stderr, "    <driver> lfw.<imgset> pairs_train"
            print >> sys.stderr, "    <driver> lfw.<imgset> pairs_test"
            print >> sys.stderr, "    <driver> lfw.<imgset> pairs_10folds"
            return 1

        if task == 'people':
            self = cls()
            image_paths = [self.image_path(m) for m in self.meta]
            names = np.asarray([m['name'] for m in self.meta])
            glumpy_viewer(img_array=larray.lmap(utils.image.load_rgb_f32,
                                                image_paths),
                          arrays_to_print=[names])
        elif task == 'pairs' or sys.argv[2] == 'pairs_train':
            raise NotImplementedError()
        elif task == 'pairs_test':
            raise NotImplementedError()
        elif task == 'pairs_10folds':
            raise NotImplementedError()
예제 #5
0
 def main_show(cls):
     from utils.glviewer import glumpy_viewer, glumpy
     self = cls()
     labels = [m['label'] for m in self.meta]
     glumpy_viewer(img_array=self._inputs,
                   arrays_to_print=[labels],
                   cmap=glumpy.colormap.Grey,
                   window_shape=(28 * 3, 28 * 3))
예제 #6
0
 def main_show(cls):
     from utils.glviewer import glumpy_viewer, command, glumpy
     self = cls()
     imgs = self.images_larray('uint8')
     Y = range(len(imgs))
     glumpy_viewer(img_array=imgs,
                   arrays_to_print=[Y],
                   cmap=glumpy.colormap.Grey)
예제 #7
0
def main_show():
    from utils.glviewer import glumpy_viewer, glumpy
    Y = [m['label'] for m in self.meta]
    glumpy_viewer(
            img_array=CIFAR10._pixels,
            arrays_to_print=[Y],
            cmap=glumpy.colormap.Grey,
            window_shape=(32 * 2, 32 * 2))
예제 #8
0
 def main_show(cls):
     from utils.glviewer import glumpy_viewer, command, glumpy
     self = cls()
     Y = [m['label'] for m in self.meta]
     glumpy_viewer(
             img_array=cls.arrays['train_images'],
             arrays_to_print=[Y],
             cmap=glumpy.colormap.Grey)
예제 #9
0
 def main_show(cls):
     from utils.glviewer import glumpy_viewer, glumpy
     self = cls()
     labels = [m['label'] for m in self.meta]
     glumpy_viewer(
             img_array=self._inputs,
             arrays_to_print=[labels],
             cmap=glumpy.colormap.Grey,
             window_shape=(28 * 3, 28 * 3))
예제 #10
0
def main_show():
    """compatibility with bin/datasets-show"""
    from utils.glviewer import glumpy_viewer
    import larray
    pf = PubFig83()
    names = [m['name'] for m in pf.meta]
    paths = [pf.image_path(m) for m in pf.meta]
    glumpy_viewer(img_array=larray.lmap(utils.image.ImgLoader(), paths),
                  arrays_to_print=[names])
예제 #11
0
파일: brodatz.py 프로젝트: Afey/skdata
 def main_show(cls):
     from utils.glviewer import glumpy_viewer, command, glumpy
     self = cls()
     imgs = self.images_larray('uint8')
     Y = range(len(imgs))
     glumpy_viewer(
             img_array=imgs,
             arrays_to_print=[Y],
             cmap=glumpy.colormap.Grey)
예제 #12
0
파일: pubfig83.py 프로젝트: Afey/skdata
def main_show():
    """compatibility with bin/datasets-show"""
    from utils.glviewer import glumpy_viewer
    import larray
    pf = PubFig83()
    names = [m['name'] for m in pf.meta]
    paths = [pf.image_path(m) for m in pf.meta]
    glumpy_viewer(
            img_array=larray.lmap(utils.image.ImgLoader(), paths),
            arrays_to_print=[names])
예제 #13
0
def show():
    Y = [m['label'] for m in self.meta]
    glumpy_viewer(img_array=CIFAR10._pixels,
                  arrays_to_print=[Y],
                  cmap=glumpy.colormap.Grey,
                  window_shape=(32 * 2, 32 * 2))