def test_resnet_encoding(self): self.encoder = BasePytorchEncoder.load_yaml(self.res_yaml) for test_img in self.test_img: vec = self.encoder.encode(test_img) print("the length of data now is:", len(test_img)) self.assertEqual(vec.shape[0], len(test_img)) self.assertEqual(vec.shape[1], 2048)
def test_inception_encoding(self): self.encoder = BasePytorchEncoder.load_yaml(self.inception_yaml) vec = self.encoder.encode(self.test_img) self.assertEqual(vec.shape[0], len(self.test_img)) self.assertEqual(vec.shape[1], 2048)
def test_vgg_encoding(self): self.encoder = BasePytorchEncoder.load_yaml(self.vgg_yaml) vec = self.encoder.encode(self.test_img) self.assertEqual(vec.shape[0], len(self.test_img)) self.assertEqual(vec.shape[1], 4096)