def testExtractFeatures_multipleLayers(self): m = Model() img = toimage(np.random.random((100, 100)) * 255) s = BuildLayer(m, Layer.C1, m.MakeState(img)) fs = ExtractFeatures((Layer.S1, Layer.C1), [s]) self.assertEqual(fs.shape[0], 1) self.assertGreater(fs.shape[1], 0)
def testExtractFeatures_multipleImages(self): m = Model() img1 = toimage(np.random.random((100, 100)) * 255) img2 = toimage(np.random.random((100, 100)) * 255) s1 = BuildLayer(m, Layer.C1, m.MakeState(img1)) s2 = BuildLayer(m, Layer.C1, m.MakeState(img2)) fs = ExtractFeatures(Layer.S1, [s1, s2]) self.assertEqual(fs.shape[0], 2) self.assertGreater(fs.shape[1], 0)