Vision API, REST: Vision.BatchAnalyze
Analyzes a batch of images and returns results with annotations.
HTTP request
POST https://vision.api.cloud.yandex.net/vision/v1/batchAnalyze
Body parameters
{
"analyzeSpecs": [
{
// Includes only one of the fields `content`, `signature`
"content": "string",
"signature": "string",
// end of the list of possible fields
"features": [
{
"type": "string",
// Includes only one of the fields `classificationConfig`, `textDetectionConfig`
"classificationConfig": {
"model": "string"
},
"textDetectionConfig": {
"languageCodes": [
"string"
],
"model": "string"
}
// end of the list of possible fields
}
],
"mimeType": "string"
}
],
"folderId": "string"
}
Field |
Description |
analyzeSpecs[] |
A list of specifications. Each specification contains the file to analyze and features to use for analysis. Restrictions:
|
folderId |
string ID of the folder to which you have access. |
AnalyzeSpec
Field |
Description |
content |
string (bytes) Image content, represented as a stream of bytes. Includes only one of the fields |
signature |
string Includes only one of the fields |
features[] |
Requested features to use for analysis. Max count of requested features for one file is 8. |
mimeType |
string MIME type |
Feature
Field |
Description |
type |
enum (Type) Type of requested feature.
|
classificationConfig |
Required for the Includes only one of the fields |
textDetectionConfig |
Required for the Includes only one of the fields |
FeatureClassificationConfig
Field |
Description |
model |
string Model to use for image classification. |
FeatureTextDetectionConfig
Field |
Description |
languageCodes[] |
string List of the languages to recognize text. |
model |
string Model to use for text detection.
|
Response
HTTP Code: 200 - OK
{
"results": [
{
"results": [
{
// Includes only one of the fields `textDetection`, `classification`, `faceDetection`, `imageCopySearch`
"textDetection": {
"pages": [
{
"width": "string",
"height": "string",
"blocks": [
{
"boundingBox": {
"vertices": [
{
"x": "string",
"y": "string"
}
]
},
"lines": [
{
"boundingBox": {
"vertices": [
{
"x": "string",
"y": "string"
}
]
},
"words": [
{
"boundingBox": {
"vertices": [
{
"x": "string",
"y": "string"
}
]
},
"text": "string",
"confidence": "string",
"languages": [
{
"languageCode": "string",
"confidence": "string"
}
],
"entityIndex": "string"
}
],
"confidence": "string"
}
]
}
],
"entities": [
{
"name": "string",
"text": "string"
}
]
}
]
},
"classification": {
"properties": [
{
"name": "string",
"probability": "string"
}
]
},
"faceDetection": {
"faces": [
{
"boundingBox": {
"vertices": [
{
"x": "string",
"y": "string"
}
]
}
}
]
},
"imageCopySearch": {
"copyCount": "string",
"topResults": [
{
"imageUrl": "string",
"pageUrl": "string",
"title": "string",
"description": "string"
}
]
},
// end of the list of possible fields
"error": {
"code": "integer",
"message": "string",
"details": [
"object"
]
}
}
],
"error": {
"code": "integer",
"message": "string",
"details": [
"object"
]
}
}
]
}
Field |
Description |
results[] |
Request results. |
AnalyzeResult
Field |
Description |
results[] |
Results for each requested feature. |
error |
The error result of the operation in case of failure or cancellation. |
FeatureResult
Field |
Description |
textDetection |
Text detection (OCR) result. Includes only one of the fields |
classification |
Classification result. Includes only one of the fields |
faceDetection |
Face detection result. Includes only one of the fields |
imageCopySearch |
Image Copy Search result. Includes only one of the fields |
error |
The error result of the operation in case of failure or cancellation. |
TextAnnotation
Field |
Description |
pages[] |
Pages of the recognized file. For JPEG and PNG files contains only 1 page. |
Page
Field |
Description |
width |
string (int64) Page width in pixels. |
height |
string (int64) Page height in pixels. |
blocks[] |
Recognized text blocks in this page. |
entities[] |
Recognized entities |
Block
Field |
Description |
boundingBox |
Area on the page where the text block is located. |
lines[] |
Recognized lines in this block. |
Polygon
Field |
Description |
vertices[] |
The bounding polygon vertices. |
Vertex
Field |
Description |
x |
string (int64) X coordinate in pixels. |
y |
string (int64) Y coordinate in pixels. |
Line
Field |
Description |
boundingBox |
Area on the page where the line is located. |
words[] |
Recognized words in this line. |
confidence |
string Confidence of the OCR results for the line. Range [0, 1]. |
Word
Field |
Description |
boundingBox |
Area on the page where the word is located. |
text |
string Recognized word value. |
confidence |
string Confidence of the OCR results for the word. Range [0, 1]. |
languages[] |
A list of detected languages together with confidence. |
entityIndex |
string (int64) Id of recognized word in entities array |
DetectedLanguage
Field |
Description |
languageCode |
string Detected language code. |
confidence |
string Confidence of detected language. Range [0, 1]. |
Entity
Field |
Description |
name |
string Entity name |
text |
string Recognized entity text |
ClassAnnotation
Field |
Description |
properties[] |
Properties extracted by a specified model. For example, if you ask to evaluate the image quality, |
Property
Field |
Description |
name |
string Property name. |
probability |
string Probability of the property, from 0 to 1. |
FaceAnnotation
Field |
Description |
faces[] |
An array of detected faces for the specified image. |
Face
Field |
Description |
boundingBox |
Area on the image where the face is located. |
ImageCopySearchAnnotation
Field |
Description |
copyCount |
string (int64) Number of image copies |
topResults[] |
Top relevance result of image copy search |
CopyMatch
Field |
Description |
imageUrl |
string url of image |
pageUrl |
string url of page that contains image |
title |
string page title that contains image |
description |
string image description |
Status
The error result of the operation in case of failure or cancellation.
Field |
Description |
code |
integer (int32) Error code. An enum value of google.rpc.Code |
message |
string An error message. |
details[] |
object A list of messages that carry the error details. |