def update(self): rgb0 = self.input.rgb H, W = self.discdds.get_shape() rgb = resize(rgb0, width=W, height=H) y0 = UncertainImage(rgb) y1 = self.action.predict(y0) pred = y1.get_rgba_fill() pred2 = resize(pred, height=rgb0.shape[0], width=rgb0.shape[1]) self.output.prediction = pred2[:, :, :3]
def received_image(self, t, imgmsg): # first thing, convert to numpy image = get_image_array(imgmsg) if self.use_zoom: processed = zoom_image_center(image, self.current_zoom, self.output_size) else: processed = resize(image, height=self.output_size[1], width=self.output_size[0]) self.queue_image.append((t, processed))