This section provides examples of how to use the Image Recognition API. The API can be used to identify objects, people, and scenes in images. Below are some common use cases and examples.
- Object Detection: Detect and classify objects in an image.
- Face Recognition: Identify and verify faces in images.
- Scene Recognition: Recognize the scene or setting depicted in an image.
Example 1: Object Detection
To detect objects in an image, you can use the following API endpoint:
GET /en/api_examples/image_recognition/object_detection
Request Parameters:
image
: Base64-encoded image data.
Response:
{
"status": "success",
"predictions": [
{
"class": "cat",
"confidence": 0.95
},
{
"class": "dog",
"confidence": 0.85
}
]
}
Example 2: Face Recognition
To recognize faces in an image, you can use the following API endpoint:
GET /en/api_examples/image_recognition/face_recognition
Request Parameters:
image
: Base64-encoded image data.
Response:
{
"status": "success",
"predictions": [
{
"name": "John Doe",
"confidence": 0.95
},
{
"name": "Jane Smith",
"confidence": 0.85
}
]
}
Example 3: Scene Recognition
To recognize the scene in an image, you can use the following API endpoint:
GET /en/api_examples/image_recognition/scene_recognition
Request Parameters:
image
: Base64-encoded image data.
Response:
{
"status": "success",
"predictions": [
"beach",
"mountain",
"city"
]
}
For more information on the Image Recognition API, please visit the API Documentation.
Image Recognition in Action
Example Image
In this image, the API correctly identified a cat and a dog.
Example Image
The API accurately recognized the faces of John Doe and Jane Smith.
Example Image