def test_lf_with_all(self): res = load_sd15ch1_frames(data_home=self.tmpdir, sample=0.1, with_model_classif_targets=True, with_modeltype_classif_targets=True, with_segmentation_targets=True, with_model_shapes=True, return_X_y=True) self.assertEqual(len(res), 5)
def test_lf_load_images(self): res = load_sd15ch1_frames(data_home=self.tmpdir, sample=0.0001, load_images=True, resize=None, color=False) for k, v in six.iteritems(res): print(k, v)
def test_eval_seg_gt_1(self): resize_factor = 0.5 data = load_sd15ch1_frames(data_home=self.tmpdir, sample=0.01, shuffle=True, resize=resize_factor, with_model_classif_targets=False, with_modeltype_classif_targets=False, with_segmentation_targets=True, with_model_shapes=True, return_X_y=False) evalres = eval_sd15ch1_segmentations(data.target_segmentations, data.target_segmentations, data.model_shapes, frame_resize_factor=resize_factor) self.assertTrue(np.allclose(evalres, np.ones_like(evalres)))
def test_lf_load_images_resize_color(self): load_sd15ch1_frames(data_home=self.tmpdir, sample=0.0001, load_images=True, resize=0.25, color=True)
def test_lf_sample_min(self): res = load_sd15ch1_frames(data_home=self.tmpdir, sample=0.000001, return_X_y=True) self.assertEqual(len(res[0]), 1)
def test_lf_return_X_y(self): load_sd15ch1_frames(data_home=self.tmpdir, return_X_y=True)
def test_lf_sample_shuffle(self): load_sd15ch1_frames(data_home=self.tmpdir, sample=0.01, shuffle=True)
def test_lf_sample_no_shuffle(self): load_sd15ch1_frames(data_home=self.tmpdir, sample=0.1, shuffle=False)
def test_lf_default(self): # this one downloads and caches everything load_sd15ch1_frames(data_home=self.tmpdir)
def test_lf_download_if_missing_false(self): with self.assertRaises(IOError): load_sd15ch1_frames(data_home=self.noneexistent, download_if_missing=False)