Пример #1
0
    def test_batch_multi_api_image(self):
        test_data = [os.path.normpath(os.path.join(DIR, "data/48by48.png")),
                     os.path.normpath(os.path.join(DIR, "data/48by48.png"))]
        response = analyze_image(test_data, apis=config.IMAGE_APIS, api_key=self.api_key)

        self.assertTrue(isinstance(response, dict))
        self.assertTrue(set(response.keys()) == set(config.IMAGE_APIS))
        self.assertTrue(isinstance(response["fer"], list))
Пример #2
0
    def test_multi_api_image(self):
        test_data = os.path.normpath(os.path.join(DIR, "data/48by48.png"))
        response = analyze_image(test_data, apis=IMAGE_APIS.keys())

        self.assertTrue(isinstance(response, dict))
        self.assertTrue(set(response.keys()) == set(IMAGE_APIS.keys()))
Пример #3
0
indicoio.fer(pixel_array)


#facial recognition

import indicoio
indicoio.config.api_key = '75b93ed62df0c77a6e58c8ebb1bb71f2'

# single example
indicoio.fer("<IMAGE>")

# batch example
indicoio.fer([
    "<IMAGE>",
    "<IMAGE>"
])

#multiple
import indicoio
indicoio.config.api_key = '75b93ed62df0c77a6e58c8ebb1bb71f2'

# single example
indicoio.analyze_image("<IMAGE>", apis=["image_features", "fer","content_filtering])

# batch example
indicoio.analyze_image([
    "<IMAGE>", 
    "<IMAGE>"
], apis=["image_features", "fer"])