blob: 8aca9c0c6711578714a453be14e197223191a7fd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
syntax = "proto3";
package yandex.cloud.ai.ocr.v1;
option go_package = "github.com/yandex-cloud/go-genproto/yandex/cloud/ai/ocr/v1;ocr";
option java_package = "yandex.cloud.api.ai.ocr.v1";
message Polygon {
// The bounding polygon vertices.
repeated Vertex vertices = 1;
}
message Vertex {
// X coordinate in pixels.
int64 x = 1;
// Y coordinate in pixels.
int64 y = 2;
}
enum Angle {
ANGLE_UNSPECIFIED = 0;
ANGLE_0 = 1;
ANGLE_90 = 2;
ANGLE_180 = 3;
ANGLE_270 = 4;
}
message TextAnnotation {
// Page width in pixels.
int64 width = 1;
// Page height in pixels.
int64 height = 2;
// Recognized text blocks in this page.
repeated Block blocks = 3;
// Recognized entities.
repeated Entity entities = 4;
repeated Table tables = 5;
// Full text recognized from image.
string full_text = 6;
// Angle of rotate image
Angle rotate = 7;
}
message Entity {
// Entity name.
string name = 1;
// Recognized entity text.
string text = 2;
}
message Block {
// Area on the page where the text block is located.
Polygon bounding_box = 1;
// Recognized lines in this block.
repeated Line lines = 2;
message DetectedLanguage {
// Detected language code.
string language_code = 1;
}
// A list of detected languages
repeated DetectedLanguage languages = 3;
// Block position from full_text string.
repeated TextSegments text_segments = 4;
}
message Line {
// Area on the page where the line is located.
Polygon bounding_box = 1;
// Recognized text.
string text = 2;
// Recognized words.
repeated Word words = 3;
// Line position from full_text string.
repeated TextSegments text_segments = 4;
// Angle of rotate line
Angle orientation = 5;
}
message Word {
// Area on the page where the word is located.
Polygon bounding_box = 1;
// Recognized word value.
string text = 2;
// ID of the recognized word in entities array.
int64 entity_index = 3;
// Word position from full_text string.
repeated TextSegments text_segments = 4;
}
message TextSegments {
// Start character position from full_text string.
int64 start_index = 1;
// Text segment length.
int64 length = 2;
}
message Table {
// Area on the page where the table is located.
Polygon bounding_box = 1;
// Number of rows in table.
int64 row_count = 2;
// Number of columns in table.
int64 column_count = 3;
// Table cells.
repeated TableCell cells = 4;
}
message TableCell {
// Area on the page where the table cell is located.
Polygon bounding_box = 1;
// Row index.
int64 row_index = 2;
// Column index.
int64 column_index = 3;
// Column span.
int64 column_span = 4;
// Row span.
int64 row_span = 5;
// Text in cell.
string text = 6;
// Table cell position from full_text string.
repeated TextSegments text_segments = 7;
}
|