def compute(self, image): img_h = ImageContainer(image) channels = img_h.prepare_image_for_processing(self.color_space) f_maps = self._compute(channels) return np.concatenate(f_maps, axis=2)
def visualize_result(self, vis_path, color_map): im_id = os.path.basename(self.image_file) vis_file = os.path.join(vis_path, im_id) img_h = ImageContainer(self.load_x()) cv2.imwrite(vis_file, img_h.overlay(color_map))
def _prepare_image(self, image): img_h = ImageContainer(image) return img_h.prepare_image_for_processing(self.color_space)
def visualize_result(self, vis_path, color_map): im_id = "{}-{}.jpg".format(self.video.id, self.frame_no) vis_file = os.path.join(vis_path, im_id) img_h = ImageContainer(self.load_x(neighbours=0)) cv2.imwrite(vis_file, img_h.overlay(color_map))