def testSample_load(self): dataset_path = self.get_test_dataset_path() filepath = dataset_path + "crosswalks/crosswalk1.png" tag = [1, 0] sample = Sample.from_file(filepath, tag) sample.load_image() self.assertIsNotNone(sample.pil_image) self.assertIsNotNone(sample.numpy_array)
def testSample_ctor(self): dataset_path = self.get_test_dataset_path() filepath = dataset_path + "crosswalks/crosswalk1.png" tag = [1, 0] sample = Sample.from_file(filepath, tag) self.assertEquals(sample.filepath, filepath) self.assertEquals(sample.tag, tag) self.assertIsNone(sample.pil_image) self.assertIsNone(sample.numpy_array)