예제 #1
0
 def test_batch_content_filtering(self):
     test_data = [os.path.normpath(os.path.join(DIR, "data/48by48.png"))]
     response = content_filtering(test_data, api_key=self.api_key)
     self.assertTrue(isinstance(response, list))
     self.assertTrue(isinstance(response[0], float))
예제 #2
0
 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))
예제 #3
0
 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))
예제 #4
0
 def test_safe_content_filtering(self):
     test_face = os.path.normpath(os.path.join(DIR, "data/happy.png"))
     response = content_filtering(test_face)
     self.assertTrue(response < 0.5)
예제 #5
0
 def test_safe_content_filtering(self):
     test_face = os.path.normpath(os.path.join(DIR, "data/happy.png"))
     response = content_filtering(test_face)
     self.assertTrue(response < 0.5)
예제 #6
0
 def test_resize_content_filtering_numpy_arrays(self):
     np = self._require_numpy()
     test_image = np.random.randint(0, 255, size=(480, 248, 3))
     response = content_filtering(test_image)
     self.assertTrue(isinstance(response, float))
예제 #7
0
 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))
예제 #8
0
 def test_batch_content_filtering(self):
     test_data = [os.path.normpath(os.path.join(DIR, "data/48by48.png"))]
     response = content_filtering(test_data)
     self.assertTrue(isinstance(response, list))
     self.assertTrue(isinstance(response[0], float))