mirror of
https://github.com/wassname/IndicoIo-python.git
synced 2026-08-15 12:04:50 +08:00
ADD: basic min axis content resizing
This commit is contained in:
committed by
Madison May
parent
1d42d6defe
commit
d00b669a16
@@ -336,6 +336,11 @@ class FullAPIRun(unittest.TestCase):
|
||||
response = content_filtering(test_face)
|
||||
self.assertTrue(response < 0.5)
|
||||
|
||||
def test_resize_content_filtering(self):
|
||||
test_face = os.path.normpath(os.path.join(DIR, "data/happy.png"))
|
||||
response = content_filtering(test_face)
|
||||
self.assertTrue(isinstance(response, float))
|
||||
|
||||
def test_good_facial_features(self):
|
||||
test_face = os.path.normpath(os.path.join(DIR, "data/48by48.png"))
|
||||
response = facial_features(test_face)
|
||||
@@ -551,6 +556,11 @@ class NumpyImagesRun(FullAPIRun):
|
||||
test_image = np.random.randint(255, 300, size=(48,48, 5))
|
||||
self.assertRaises(IndicoError, image_features, test_image)
|
||||
|
||||
def test_resize_content_filtering_numpy_arrays(self):
|
||||
test_image = np.random.randint(0, 255, size=(480,248, 3))
|
||||
response = content_filtering(test_image)
|
||||
self.assertTrue(isinstance(response, float))
|
||||
|
||||
def flatten(container):
|
||||
for i in container:
|
||||
if isinstance(i, list) or isinstance(i, tuple):
|
||||
|
||||
Reference in New Issue
Block a user