Exemplo n.º 1
0
    def __init__(self,
                 ts=None,
                 cache_path=defines.base_path + 'cache/',
                 fullscreen=False,
                 resolution=(800, 400),
                 icon_path=defines.base_path + 'icons/slideshow.png'):
        super(Slideshow, self).__init__('Slideshow', cache_path, fullscreen,
                                        resolution, icon_path)
        self.playing = True
        self.stream = ImageStreamDir(load_strategy='paths')

        if ts:
            self.ts = ts
        else:
            self.ts = TouchScreen()

        self.delay = 5.0  # seconds
        self.last_update = time() - self.delay
        self.fading = False
        self.fade_time = 2.0  # seconds
        self.fade_start = time()
        self.last_image = None
        self.cur_image = None
        self.image_corner = (30, 90)

        self.buttons.append(
            Button(self, 'next', (260, 10, 80, 40), (50, 50, 50), self.next))
        self.buttons.append(
            Button(self, 'previous', (100, 10, 145, 40), (50, 50, 50),
                   self.prev_image))
Exemplo n.º 2
0
	def __init__(self, ts=None, cache_path=defines.base_path+'cache/', fullscreen=False, resolution=(800, 400), 
					icon_path=defines.base_path+'icons/MET.png'):
		super(SlideshowMET, self).__init__('SlideshowMET', cache_path, fullscreen, resolution, icon_path)
		self.playing = True
		self.stream = ImageStreamMET()
		self.stream.get_favorite()

		if ts:
			self.ts = ts
		else:
			self.ts = TouchScreen()

		self.delay = 5.0 # seconds
		self.last_update = time() - self.delay
		self.fading = False
		self.fade_time = 2.0 # seconds
		self.fade_start = time()
		self.last_image = None

		self.cur_image = None
		self.image_corner = (30,90)
		self.image_crop = (300, 400, 3)
		self.image_fixed_size = np.zeros(self.image_crop)
		self.last_image_fixed_size = np.zeros(self.image_crop)
		self.buttons.append(Button(self, 'more', (460,10,80,40), (50,50,50), self.more))
		self.buttons.append(Button(self, 'next', (260,10,80,40), (50,50,50), self.next))
		self.buttons.append(Button(self, 'previous', (100,10,145,40), (50,50,50), self.prev_image))
Exemplo n.º 3
0
 def __init__(self,
              ts=None,
              cache_path=defines.base_path + 'cache/',
              fullscreen=False,
              resolution=(800, 400),
              icon_path=defines.base_path + 'icons/google.png'):
     super(GoogleSlider, self).__init__('GoogleSlider', cache_path,
                                        fullscreen, resolution, icon_path)
     if ts:
         self.ts = ts
     else:
         self.ts = TouchScreen()
     self.playing = True
     self.buttons.append(
         Button(self, 'more', (100, 10, 85, 40), (50, 50, 50),
                self.get_more_images))
     self.keywords = [
         'fractals', 'lucidtronix', 'trending', 'beauty', 'sunset',
         'caravaggio', 'chiaroscuro', 'evolution', 'ocean',
         'samwell freeman', 'neural network', 'achievement', 'trees',
         'palms', 'friends', 'cute animals', 'learning', 'truth',
         'current events', 'news', 'timeless', 'mountains'
     ]
     self.cur_keyword = random.randrange(len(self.keywords))
     self.stream = ImageStreamGoogle((480, 640, 3), "google", cache_path,
                                     'cv2', self.keywords[self.cur_keyword],
                                     5, 0)
     self.row = ImageRow(self, self.stream, self.ts, self.resolution)
     self.redraw = True
Exemplo n.º 4
0
    def __init__(self,
                 ts=None,
                 cache_path=defines.base_path + '/cache/',
                 fullscreen=False,
                 resolution=(800, 400),
                 icon_path=defines.base_path + '/icons/cv_client.png'):
        super(CVClient, self).__init__('CVClient', cache_path, fullscreen,
                                       resolution, icon_path)
        self.playing = True
        self.stream = ImageStreamDir()
        if ts:
            self.ts = ts
        else:
            self.ts = TouchScreen()

        self.camera = PiCamera()
        self.camera.resolution = (320, 240)
        self.camera.framerate = 32
        self.rawCapture = PiRGBArray(self.camera, size=(320, 240))
        self.faceCascade = cv2.CascadeClassifier(
            defines.base_path + '/haarcascade_frontalface_default.xml')
        self.pil_im_to_classify = Image.open(defines.base_path +
                                             'images/baby.jpg')
        self.last_face = np.array(self.pil_im_to_classify)
        self.classifications = []

        self.buttons.append(
            Button(self, 'classify', (100, 10, 125, 40), (50, 50, 50),
                   self.classify_pil_im))

        # allow the camera to warmup
        sleep(0.2)
Exemplo n.º 5
0
	def __init__(self, feed, x, y, app):
		self.feed = feed
		self.x = x
		self.y = y
		self.app = app
		self.show_me = False
		self.feed.title = self.feed.title.encode('ascii','ignore')

		self.btn = Button(self.app, self.feed.title[:42], (x, y,85,30), (50,50,50), self.toggle_show)
		self.images = [] 
			
		self.keyword = self.feed.title[:12].replace(' ', '_')


		self.keyword_path =defines.base_path+'cache/news/' + self.keyword
		if not os.path.exists(self.keyword_path):
			os.makedirs(self.keyword_path)

		self.row = None