πŸ“· Image Analysis

Edenai AI agregates a large set of image analysis features from a variety of well know providers like amazon, google, Microsoft, picpurify, Clarifai and many others. With just a few lines of codes, and without any heavy configurations, Eden AI allows you to perform and use image analysis technologies quickly and efficiently.

Subfeatures

Below, is a complete list of all image analysis features on Eden AI:

Object detection

Object detection is a computer vision technique that allows to identify and locate objects in an image. It takes an image as input and identifies all instances of objects within the image scene. Objects detected within the image are categorized into a class with a confidence score, and their locations are indicated with a rectangular bounding box.

Supported MIME Types and features

The MIME types supported by Eden AI for each provider are listed in the following excel table; also listed are the features that are provider-specific.

🚧

Indication

Please verify that the MIME type used to submit an image for object detection is supported for the provider(s) you want to use. Ultimate Guide

usage

To perform an image analysis object detection, you need to perform a POST request to the API endpoint with the image file you want to analyze and the list of providers you want to use. The API call will return a JSON object containing the standardized response.

πŸ“˜

Note

You can still access the original response of each of the providers specified in the request by including the parameter show_original_response with the value True

import json
import requests

headers = {"Authorization": "Bearer πŸ”‘ Your_API_Key"}

url = "https://api.edenai.run/v2/image/object_detection"              	 
data={"providers": "amazon,clarifai"}
files = {'file': open("πŸ–ΌοΈ path/to/your/image.png",'rb')}

response = requests.post(url, data=data, files=files, headers=headers)
data = response.json()

For a successful call, the API call will return a JSON response in form of a JSON Object with the status and the standardized response for each provider as show below.

{
    "amazon": {
        "status": "success",
        "items": [
            {
                "label": "Scoreboard",
                "confidence": 0.9918264007568359,
                "x_min": 0.010680916719138622,
                "x_max": 0.9901009229943156,
                "y_min": 0.0039025116711854935,
                "y_max": 0.9904575515538454
            },
            {
                "label": "Text",
                "confidence": 0.9726490783691406,
                "x_min": null,
                "x_max": null,
                "y_min": null,
                "y_max": null
            },
           ..
        ]
    },
    "clarifai": {
        "status": "success",
        "items": [
            {
                "label": "Poster",
                "confidence": 0.9730863,
                "x_min": null,
                "x_max": 0.99915546,
                "y_min": 0.004937499,
                "y_max": 1.0
            }
        ]
    }
}

The API response will contain the items key which will contain in return a JSON Array with all the objects detected within the image. Each object will have a label, a confidence score between 0 and 1 and a bounding box defined by the four values: x_min, x_max, y_min and y_max.

Face detection

Face detection is a computer technology widely used in a variety of applications that identifies human faces in digital images. It permits to get information where faces are detected in an image, facial landmarks as mouth or eyes position, detected emotion age or even gender.

Supported MIME Types and features

The MIME types supported by Eden AI for face detection for each provider are listed in the following excel table; also listed are the features that are provider-specific.

🚧

Indication

Please verify that the MIME type used to submit an image for object detection is supported for the provider(s) you want to use. Ultimate Guide

( il me faut le guide face detection)

Usage

To perform an image analysis face detection, you need to perform a POST request to the API endpoint with the image file you want to analyze and the list of providers you want to use. The API call will return a JSON object containing the standardized response.

import json
import requests

headers = {"Authorization": "Bearer πŸ”‘ Your_API_Key"}

url = "https://api.edenai.run/v2/image/face_detection"
data = {"providers": "amazon"}
files = {'file': open("πŸ–ΌοΈ path/to/your/image.png",'rb')}

response = requests.post(url, data=data, files=files, headers=headers)

result = response.json()

For a successful call, the API call will return a JSON response in form of a JSON Object with the status and the standardized response for each provider as show below.

{
    "amazon": {
        "status": "success",
        "items": [
            {
                "confidence": 0.9999436187744141,
                "landmarks": {
                    "left_eye": [],
                    "left_eye_top": [],
                    "left_eye_right": [],
                    "left_eye_bottom": [
                        0.5552057027816772,
                        0.3742150366306305
                    ],
                    "left_eye_left": [
                        0.5438706874847412,
                        0.37398093938827515
                    ],
                    "right_eye": [],
                    
                    "chin_left_gonion": [],
                    "chin_right_gonion": [],
                    "upper_jawline_left": [
                        0.5301230549812317,
                        0.3897511959075928
                    ],
                    "mid_jawline_left": [
                        0.559543788433075,
                        0.481594979763031
                    ],
                    "mid_jawline_right": [
                        0.6737728714942932,
                        0.4466959536075592
                    ]
                },
                "emotions": {
                    "joy": 5,
                    "sorrow": null,
                    "anger": 3,
                    "surprise": null,
                    "disgust": null,
                    "fear": 5,
                    ..
                },
                "poses": {
                    "pitch": 10.312082290649414,
                    "roll": -15.384145736694336,
                    "yaw": -9.725109100341797
                },
                "age": 27.0,
                "gender": "Male",
                "bounding_box": {
                    },
                "hair": {
                    "hair_color": [],
                    "bald": null,
                    "invisible": null
                },
                "facial_hair": {
                    "moustache": 0.8897360229492187,
                    "beard": 0.9679095458984375,
                    "sideburns": null
                },
                "quality": {
                    },
                "makeup": {
                    "eye_make": null,
                    "lip_make": null
                },
                "accessories": {
                    },
                "occlusions": {
                    "eye_occluded": null,
                    "forehead_occluded": null,
                    "mouth_occluded": null
                },
                "features": {
                    "eyes_open": 0.0,
                    "smile": 0.0,
                    "mouth_open": 0.0
                }
            }
        ]
    }
}

The API response will contain the items key which will contain in return a JSON Array with all the information extracted within the image. The standardized response will contain all extracted data related the faces detected in the image. For example: landmarks information, emotions, poses, age, hair, facial hair and many other information shown in the response example above.

Explicit Content Detection

Explicit content detection is a technology that detects adult only content in images, which is considered generally inappropriate for people under the age of 18 and may include nudity, sexual activity or pornography.

Supported MIME Types and features

The MIME types supported by Eden AI for explicit content detection for each provider are listed in the following excel table; also listed are the features that are provider-specific.

🚧

Indication

Please verify that the MIME type used to submit an image for object detection is supported for the provider(s) you want to use. Ultimate Guide

Usage

To perform an image analysis explicit content detection, you need to perform a POST request to the API endpoint with the image file you want to analyze and the list of providers you want to use. The API call will return a JSON object containing the standardized response.

import requests

headers = {"Authorization": "Bearer πŸ”‘ Your_API_Key"}

url=" https://api.edenai.run/v2/image/explicit_content"
data={"providers": "amazon,clarifai"}
files = {'file': open("πŸ–ΌοΈ path/to/your/image.png",'rb')}

response = requests.post(url, data=data, files=files, headers=headers)

result = response.json()

For a successful call, the API call will return a JSON response in form of a JSON Object with the status and the standardized response for each provider as show below.

{
    "clarifai": {
        "status": "success",
        "nsfw_likelihood": 4,
        "items": [
            {
                "label": "explicit",
                "likelihood": 4
            },
            {
                "label": "suggestive",
                "likelihood": 3
            },
            {
                "label": "drug",
                "likelihood": 1
            },
            {
                "label": "gore",
                "likelihood": 1
            },
            {
                "label": "safe",
                "likelihood": 1
            }
        ]
    },
    "amazon": {
        "status": "success",
        "nsfw_likelihood": 5,
        "items": [
            {
                "label": "Nudity",
                "likelihood": 5
            },
            {
                "label": "Explicit Nudity",
                "likelihood": 5
            }
        ]
    }
}

The API response will contain the nsfw_likelihood key which indicate a score between 1 and 5 about the content's likelihood safety for work , also know as NSFW , an abbreviation for Not Safe For Work , used when sharing internet material that should only be looked at in private. The nsfw_likelihood score value is computed as the maximum score of the items classes handled by the provider and displayed within the items key, each also with a score between 1 and 5.

Landmark Detection

Landmark detection is a technology that can detects popular natural and human-made structures within an image.

Supported MIME Types and features

The MIME types supported by Eden AI for landmark detection for each provider are listed in the following excel table; also listed are the features that are provider-specific.

🚧

Indication

Please verify that the MIME type used to submit an image for object detection is supported for the provider(s) you want to use. ) you want to us(could not find the link)

( il me faut le guide landmark detection)

Usage

To perform an image analysis landmark detection, you need to perform a POST request to the API endpoint with the image file you want to analyze and the list of providers you want to use. The API call will return a JSON object containing the standardized response.

import requests

headers = {"Authorization": "Bearer πŸ”‘ Your_API_Key"}

url=" https://api.edenai.run/v2/image/landmark_detection"
data={"providers": "google,microsoft"}
files = {'file': open("πŸ–ΌοΈ path/to/your/image.png",'rb')}

response = requests.post(url, data=data, files=files, headers=headers)
data = response.json()

For a successful call, the API call will return a JSON response in form of a JSON Object with the status and the standardized response for each provider as show below.

{
    "microsoft": {
        "status": "success",
        "items": [
            {
                "description": "Saint Basil's Cathedral",
                "confidence": 0.9888749122619629,
                "bounding_box": [],
                "locations": []
            }
        ]
    },
    "google": {
        "status": "success",
        "items": [
            {
                "description": "Saint Basil's Cathedral",
                "confidence": 0.9253676,
                "bounding_box": [
                    {
                        "x": 73,
                        "y": 175
                    },
                    {
                        "x": 398,
                        "y": 175
                    }
                    ..
                ],
                "locations": [
                    {
                        "lat_lng": {
                            "latitude": 55.752912,
                            "longitude": 37.622315883636475
                        }
                    }
                ]
            }
            ..
        ]
    }
}

The API response will contain the items key which will contain in return a JSON Array with all the landmark objects detected within the image. Each object will have a description, a confidence score between 0 and 1, a bounding box and the location's coordinates (latitude and longitude).

Logo Detection

Logo detection is a technology that can detects popular logos within an image.

Supported MIME Types and features

The MIME types supported by Eden AI for logo detection for each provider are listed in the following excel table; also listed are the features that are provider-specific.

🚧

Indication

Please verify that the MIME type used to submit an image for object detection is supported for the provider(s) you want to use. Ultimate Guide

Usage

To perform an image analysis logo detection, you need to perform a POST request to the API endpoint with the image file you want to analyze and the list of providers you want to use. The API call will return a JSON object containing the standardized response.

import requests

headers = {"Authorization": "Bearer πŸ”‘ Your_API_Key"}

url=" https://api.edenai.run/v2/image/logo_detection"
data={"providers": "google"}
files = {'file': open("πŸ–ΌοΈ path/to/your/image.png",'rb')}

response = requests.post(url, data=data, files=files, headers=headers)
data = response.json()

For a successful call, the API call will return a JSON response in form of a JSON Object with the status and the standardized response for each provider as show below.

{
    "google": {
        "status": "success",
        "items": [
            {
                "bounding_poly": {
                    "vertices": [
                        {
                            "x": 8.0,
                            "y": 8.0
                        },
                        {
                            "x": 1122.0,
                            "y": 8.0
                        },
                        {
                            "x": 1122.0,
                            "y": 498.0
                        },
                        {
                            "x": 8.0,
                            "y": 498.0
                        }
                    ]
                },
                "description": "CJ Group",
                "score": 0.55006355
            }
        ]
    }
}

The API response will contain the items key which will contain in return a JSON Array with all the logos detected within the image. Each object will have a bounding polygondefined with a list of vertices, a description and a score varying between 0 and 1.

Anonymization

Image Anonymizationis a technology that automatically detects faces and license plates in an image and applies blurring making sensitive areas unrecognizable.

Supported MIME Types and features

The MIME types supported by Eden AI for anonymization are listed in the following excel table alongside the supported features.

Usage

To perform an image anonymization, you need to perform a POST request to the API endpoint with the image file you want to analyze and the list of providers you want to use. The API call will return a JSON object containing the standardized response.

import requests

headers = {"Authorization": "Bearer πŸ”‘ Your_API_Key"}

url=" https://api.edenai.run/v2/image/anonymization"
data={"providers": "api4ai"}
files = {'file': open("πŸ–ΌοΈ path/to/your/image.png",'rb')}

response = requests.post(url, data=data, files=files, headers=headers)
data = response.json()

For a successful call, the API call will return a JSON response in form of a JSON Object with the status and the standardized response for each provider as show below.

{
    "api4ai": {
      "status": "success",
      "image": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJbL....",
      "items": [
        {
          "kind": "Face",
          "confidence": 0.894121527671814,
          "bounding_boxes": {
            "x_min": 0.24183006535947713,
            "x_max": 0.14460784313725492,
            "y_min": 0.17483660130718953,
            "y_max": 0.3014705882352941
          }
        },
        {
          "kind": "Face",
          "confidence": 0.9647151231765747,
          "bounding_boxes": {
            "x_min": 0.6813725490196079,
            "x_max": 0.2696078431372549,
            "y_min": 0.20588235294117646,
            "y_max": 0.3602941176470588
          }
        }
        ..
      ]
    }
  }

The API response will contain the image key with the base64 encoding format of the image with the anonymization applied; also, listed are the faces detected within the image inside a JSON Array referenced by the key items. Each item contains a confidence score between 0 and 1 and a bounding_box as show above.

Similarity Search

Similarity search allows you to look for and extract images in an existing database that are similar to a query image.

Supported MIME Types and features

The MIME types supported by Eden AI for similarity search are listed in the following excel table alongside the supported features.

( il me faut le guide similarity search)

Usage

  • Upload images. In order to perform a similarity search, you need first to have some images uploaded that will be used as a data set for your image similarity search queries. To do so, a POST request to the API endpoint is needed (as shown below) with the image file to upload.
import requests

headers = {"Authorization": "Bearer πŸ”‘ Your_API_Key"}

url = "https://api.edenai.run/v2/image/search/upload_image"              	 
data={"providers": "sentisight", "image_name": "test_image"}
files = {'file': open("πŸ–ΌοΈ path/to/your/image.png",'rb')}

response = requests.post(url, data=data, files=files, headers=headers)
result = response.json()
  • Get image(s). You can return a specific image or list all the images uploaded into your data set using the following API endpoints as shown below.

To list all images upload into the data set:

import requests

headers = {"Authorization": "Bearer πŸ”‘ Your_API_Key"}

url = "https://api.edenai.run/v2/image/search/get_images"              	 
data={"providers": "sentisight"}

response = requests.post(url, data=data, files=files, headers=headers)
data = response.json()

To get a specific image from your data set by it's image name:

import requests

headers = {"Authorization": "Bearer πŸ”‘ Your_API_Key"}

url = "https://api.edenai.run/v2/image/search/get_image"              	 
data={"providers": "sentisight", "image_name": "test_image"}

response = requests.post(url, data=data, files=files, headers=headers)
data = response.json()
  • Delete Image. You can also delete delete a specific image from your data set using the following code.
import requests

headers = {"Authorization": "Bearer πŸ”‘ Your_API_Key"}

url = "https://api.edenai.run/v2/image/search/delete_image"              	 
data={"providers": "sentisight", "image_name": "test_image"}

response = requests.post(url, data=data, files=files, headers=headers)
data = response.json()
  • Launch similarity. Finally, to perform a similarity search, you need to perform a POST request to the following endpoint.
import requests

headers = {"Authorization": "Bearer πŸ”‘ Your_API_Key"}

url = "https://api.edenai.run/v2/image/search/launch_similarity"              	 
data={"providers": "sentisight"}
files = {'file': open("πŸ–ΌοΈ path/to/your/image.png",'rb')}

response = requests.post(url, data=data, files=files, headers=headers)
data = response.json()
print(data['sentisight'])

Supported programming languages

Eden AI image analysis is programming language constraints free, which means users can use any programming languages using a unique API Getting Started

πŸ“˜

Note

You can find an Opened Sourced version of EdenAI that you can can find on github as a python module

Pricing

By default the image features pricing is calculated per units of 1 files. For more details, please refer to each feature pricing in the documentation. The image features pricing is displayed per units of 1000 files

You can use all those technologies through the platform or API. Do not hesitate to check our Getting Started With Your API to use API.