Back to top

Visual Intelligence API



DeepVision’s Visual Intelligence API is composed by the following main modules:

Visual Face

The model detects and recognizes faces in image and video content and provides coordinate locations of the facial detection allowing face counting. In addition, the model can perform facial verification for target subjects. The model also provides demographic information (age and gender of people). Our current library contains the ability to recognize 5,000+ celebrities and custom faces from customer’s private repositories can easily be added to the model.

Visual Brand

This model identifies and provides coordinate locations of brand logos in image and video content. The model is able to detect brand logos on objects, clothing, advertisements, and in various other forms. We can customize which brands to detect and new custom brands can be added to our models upon request.

Visual Context

This model identifies and predicts concepts in image and video content. The model supports over 13,000+ general concepts and can categorize image and video content. Additional tagged concepts can also be added to the model upon request. Visual Context allows for auto-categorization of products and objects and provides conceptual context to video and images content.

This model identifies objects in image and video content and provides the ability to visually search for a target object. The model will return exact object matches as well as visually similar objects including similarity scores against the target object. Our API can easily integrate with product inventories or object galleries.




Authentication


How to get access?

To get access to our Visual Intelligence API please contact us, you just need to request your token. Then, with your token, you can start sending requests to Visual Intelligence API.




Predict


With Predict, you can understand your images and get the most value out of them. Using our Visual Intelligence API is very easy and straightforward:

Predict with an URL

With the following request you can send your image URL to the API and you’ll get a full list of concepts and it’s corresponding probabilities telling you how likely we are about those concepts are in your image. You can choose whether you want all the models (Visual Vehicle and Visual Context) running at the same time, or just a combination of them.

Request

curl -X POST visualintelligence.deepvisionai.com/image_url?url_auth_token=<token> -F url=http://deepvisionai.com/img/us/team.png

Endpoint: /image_url

Query parameters

url_auth_token string Your access token to the API.

Post parameters

computeFace string Must be either “true” or “false”. Defaults to "false”.
computeBrand string Must be either “true” or “false”. Defaults to "false”.
computeContext string Must be either “true” or “false”. Defaults to "false”.
faceAge string Must be either “true” or “false”. Defaults to "false”.
faceGender string Must be either “true” or “false”. Defaults to "false”.
faceRecognize string Must be either “true” or “false”. Defaults to "false”.
url string (required) URL of image to be downloaded.

Response

{
    "brands": [
        {
            "bbox": {
                "left": 294,
                "top": 317,
                "right": 508,
                "bottom": 400
            },
            "brand": {
                "score": 0.83427,
                "tag": "nike"
            }
        }
    ],
    "face": [
        {
            "bbox": {
                "left": 294,
                "top": 317,
                "right": 508,
                "bottom": 400,
                "score": 0.99123
            },
            "age": {
                "score": 0.92127,
                "tag": 42
            },
            "gender": {
                "score": 0.90243,
                "tag": "male"
            },
            "recognize": {
                "score": 0.87237,
                "tag": {
                    "name": "Di Caprio",
                    "entity_id": "asdfhadfe3dC"
                }
            }
        }
    ],
    "context": [
        {
            "humanlike": [
                {
                    "tag": "cargo ship",
                    "score": 0.12186
                },
                {
                    "tag": "vessel",
                    "score": 0.10692
                }
            ],
            "related": [
                {
                    "tag": "storing liquids",
                    "score": 0.12186
                },
                {
                    "tag": "shipping",
                    "score": 0.10692
                }
            ],
            "extra": [
                {
                    "tag": "water transportation",
                    "score": 0.12186
                },
                {
                    "tag": "outer space",
                    "score": 0.10692
                }
            ]
        }
    ]
}

Predict by uploading an image

In this case, instead of sending an image URL, we are providing the image file to the API. You’ll get exactly the same response as before but now passing your image in a different way.

Request

curl -X POST visualintelligence.deepvisionai.com/upload_image?url_auth_token=<token> -F file=@/path/to/img/

Endpoint: /upload_image

Query parameters

url_auth_token string Your access token to the API.

Post parameters

computeFace string Must be either “true” or “false”. Defaults to “true”.
computeBrand string Must be either “true” or “false”. Defaults to “true”.
computeContext string Must be either “true” or “false”. Defaults to “true”.
faceAge string Must be either “true” or “false”. Defaults to “true”.
faceGender string Must be either “true” or “false”. Defaults to “true”.
faceRecognize string Must be either “true” or “false”. Defaults to “true”.
image file (required) Attach a single image to your request.

Response

{
    "brands": [
        {
            "bbox": {
                "left": 294,
                "top": 317,
                "right": 508,
                "bottom": 400
            },
            "brand": {
                "score": 0.83427,
                "tag": "nike"
            }
        }
    ],
    "face": [
        {
            "bbox": {
                "left": 294,
                "top": 317,
                "right": 508,
                "bottom": 400,
                "score": 0.99123
            },
            "age": {
                "score": 0.92127,
                "tag": 42
            },
            "gender": {
                "score": 0.90243,
                "tag": "male"
            },
            "recognize": {
                "score": 0.87237,
                "tag": {
                    "name": "Di Caprio",
                    "entity_id": "asdfhadfe3dC"
                }
            }
        }
    ],
    "context": [
        {
            "humanlike": [
                {
                    "tag": "cargo ship",
                    "score": 0.12186
                },
                {
                    "tag": "vessel",
                    "score": 0.10692
                }
            ],
            "related": [
                {
                    "tag": "storing liquids",
                    "score": 0.12186
                },
                {
                    "tag": "shipping",
                    "score": 0.10692
                }
            ],
            "extra": [
                {
                    "tag": "water transportation",
                    "score": 0.12186
                },
                {
                    "tag": "outer space",
                    "score": 0.10692
                }
            ]
        }
    ]
}



Visual Search


With this module you can get the most visually similar products to the query image in your collection of images. This process requires two steps:

  1. You need to upload your collection of images,

  2. Then, you can query with new images and you’ll be able to find the most similar products in your collection.

The model will return a ranked list of images and similarity scores based on how similar the results are when compared to the query image.

Add images to the database

With the following request, you’ll be able to upload your collection of images. You can add an alias “name” to your images so that you can find them in your system later on. In addition, you can add an ID or name to your subset of images, so you can then search only in that subset space.

Request

curl -X POST visualintelligence.deepvisionai.com/add_product?url_auth_token=<token> -F image=@/path/to/img/ -F imageId=ab21bc123 -F subset=phones

Endpoint: /add_product

Query parameters

url_auth_token string Your access token to the API.

Post parameters

image file (required*) Attach a single image to your request.
imageUrl string (required*) URL of image that will be downloaded.
imageId string (required) Identifier of the product.
subset string optional Name of the subset of images.
  • You must send either image or imageUrl, but you can’t send both at the same time.

Response

If successful, this endpoint returns the HTTP code 204 (No Content). There’s no output to parse.

Query for similar images

With the following request, you can query the model with your image and you’ll get the top 5 most visually similar results from your collection of images.

Request

curl -X POST visualintelligence.deepvisionai.com/find_product?url_auth_token=<token> -F image=@/path/to/img/

Endpoint: /find_product

Query parameters

url_auth_token string Your access token to the API.

Post parameters

subset string optional Name of the subset in which close images will be searched. If not set, all images are evaluated.
results number optional Amount of results that will be returned. Defaults to 5.
image file (required*) Attach a single image to your request.
imageUrl string (required*) URL of image that will be downloaded.
  • You must send either image or imageUrl, but you can’t send both at the same time.

Response

[
  {
    "score": 0.972312,
    "image": "visualintelligence.deepvisionai.com/image1.jpg",
    "imageId": "123ab21cd78e4623"
  },
  {
    "score": 0.95421,
    "image": "visualintelligence.deepvisionai.com/image2.jpg",
    "imageId": "21cd78e4623123ab"
  },
  {
    "score": 0.913434,
    "image": "visualintelligence.deepvisionai.com/image3.jpg",
    "imageId": "4623123ab21cd78e"
  },
  {
    "score": 0.872312,
    "image": "visualintelligence.deepvisionai.com/image4.jpg",
    "imageId": "b21cd7123a8e4623"
  },
  {
    "score": 0.823223,
    "image": "visualintelligence.deepvisionai.com/image5.jpg",
    "imageId": "1cd78e4623123ab2"
  }
]