- Resource: Example
- Annotation
- AnnotationValue
- ImageClassificationAnnotation
- ImageBoundingPolyAnnotation
- BoundingPoly
- Vertex
- NormalizedBoundingPoly
- NormalizedVertex
- ImagePolylineAnnotation
- Polyline
- NormalizedPolyline
- ImageSegmentationAnnotation
- TextClassificationAnnotation
- TextEntityExtractionAnnotation
- SequentialSegment
- VideoClassificationAnnotation
- TimeSegment
- VideoObjectTrackingAnnotation
- ObjectTrackingFrame
- VideoEventAnnotation
- AnnotationMetadata
- OperatorMetadata
- AnnotationSentiment
- Methods
Resource: Example
An Example is a piece of data and its annotation. For example, an image with label "house".
JSON representation | |
---|---|
{ "name": string, "annotations": [ { object ( |
Fields | ||
---|---|---|
name |
Output only. Name of the example, in format of: projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/ {annotated_dataset_id}/examples/{example_id} |
|
annotations[] |
Output only. Annotations for the piece of data in Example. One piece of data can have multiple annotations. |
|
Union field payload . Output only. The data part of Example. payload can be only one of the following: |
||
imagePayload |
The image payload, a container of the image bytes/uri. |
|
textPayload |
The text payload, a container of the text content. |
|
videoPayload |
The video payload, a container of the video uri. |
Annotation
Annotation for Example. Each example may have one or more annotations. For example in image classification problem, each image might have one or more labels. We call labels binded with this image an Annotation.
JSON representation | |
---|---|
{ "name": string, "annotationSource": enum ( |
Fields | |
---|---|
name |
Output only. Unique name of this annotation, format is: projects/{project_id}/datasets/{dataset_id}/annotatedDatasets/{annotatedDataset}/examples/{example_id}/annotations/{annotation_id} |
annotationSource |
Output only. The source of the annotation. |
annotationValue |
Output only. This is the actual annotation value, e.g classification, bounding box values are stored here. |
annotationMetadata |
Output only. Annotation metadata, including information like votes for labels. |
annotationSentiment |
Output only. Sentiment for this annotation. |
AnnotationValue
Annotation value for an example.
JSON representation | |
---|---|
{ // Union field |
Fields | ||
---|---|---|
Union field
|
||
imageClassificationAnnotation |
Annotation value for image classification case. |
|
imageBoundingPolyAnnotation |
Annotation value for image bounding box, oriented bounding box and polygon cases. |
|
imagePolylineAnnotation |
Annotation value for image polyline cases. Polyline here is different from BoundingPoly. It is formed by line segments connected to each other but not closed form(Bounding Poly). The line segments can cross each other. |
|
imageSegmentationAnnotation |
Annotation value for image segmentation. |
|
textClassificationAnnotation |
Annotation value for text classification case. |
|
textEntityExtractionAnnotation |
Annotation value for text entity extraction case. |
|
videoClassificationAnnotation |
Annotation value for video classification case. |
|
videoObjectTrackingAnnotation |
Annotation value for video object detection and tracking case. |
|
videoEventAnnotation |
Annotation value for video event case. |
ImageClassificationAnnotation
Image classification annotation definition.
JSON representation | |
---|---|
{
"annotationSpec": {
object ( |
Fields | |
---|---|
annotationSpec |
Label of image. |
ImageBoundingPolyAnnotation
Image bounding poly annotation. It represents a polygon including bounding box in the image.
JSON representation | |
---|---|
{ "annotationSpec": { object ( |
Fields | ||
---|---|---|
annotationSpec |
Label of object in this bounding polygon. |
|
Union field bounded_area . The region of the polygon. If it is a bounding box, it is guaranteed to be four points. bounded_area can be only one of the following: |
||
boundingPoly |
|
|
normalizedBoundingPoly |
|
BoundingPoly
A bounding polygon in the image.
JSON representation | |
---|---|
{
"vertices": [
{
object ( |
Fields | |
---|---|
vertices[] |
The bounding polygon vertices. |
Vertex
A vertex represents a 2D point in the image. NOTE: the vertex coordinates are in the same scale as the original image.
JSON representation | |
---|---|
{ "x": number, "y": number } |
Fields | |
---|---|
x |
X coordinate. |
y |
Y coordinate. |
NormalizedBoundingPoly
Normalized bounding polygon.
JSON representation | |
---|---|
{
"normalizedVertices": [
{
object ( |
Fields | |
---|---|
normalizedVertices[] |
The bounding polygon normalized vertices. |
NormalizedVertex
A vertex represents a 2D point in the image. NOTE: the normalized vertex coordinates are relative to the original image and range from 0 to 1.
JSON representation | |
---|---|
{ "x": number, "y": number } |
Fields | |
---|---|
x |
X coordinate. |
y |
Y coordinate. |
ImagePolylineAnnotation
A polyline for the image annotation.
JSON representation | |
---|---|
{ "annotationSpec": { object ( |
Fields | ||
---|---|---|
annotationSpec |
Label of this polyline. |
|
Union field
|
||
polyline |
|
|
normalizedPolyline |
|
Polyline
A line with multiple line segments.
JSON representation | |
---|---|
{
"vertices": [
{
object ( |
Fields | |
---|---|
vertices[] |
The polyline vertices. |
NormalizedPolyline
Normalized polyline.
JSON representation | |
---|---|
{
"normalizedVertices": [
{
object ( |
Fields | |
---|---|
normalizedVertices[] |
The normalized polyline vertices. |
ImageSegmentationAnnotation
Image segmentation annotation.
JSON representation | |
---|---|
{
"annotationColors": {
string: {
object( |
Fields | |
---|---|
annotationColors |
The mapping between rgb color and annotation spec. The key is the rgb color represented in format of rgb(0, 0, 0). The value is the AnnotationSpec. |
mimeType |
Image format. |
imageBytes |
A byte string of a full image's color map. A base64-encoded string. |
TextClassificationAnnotation
Text classification annotation.
JSON representation | |
---|---|
{
"annotationSpec": {
object ( |
Fields | |
---|---|
annotationSpec |
Label of the text. |
TextEntityExtractionAnnotation
Text entity extraction annotation.
JSON representation | |
---|---|
{ "annotationSpec": { object ( |
Fields | |
---|---|
annotationSpec |
Label of the text entities. |
sequentialSegment |
Position of the entity. |
SequentialSegment
Start and end position in a sequence (e.g. text segment).
JSON representation | |
---|---|
{ "start": number, "end": number } |
Fields | |
---|---|
start |
Start position (inclusive). |
end |
End position (exclusive). |
VideoClassificationAnnotation
Video classification annotation.
JSON representation | |
---|---|
{ "timeSegment": { object ( |
Fields | |
---|---|
timeSegment |
The time segment of the video to which the annotation applies. |
annotationSpec |
Label of the segment specified by timeSegment. |
TimeSegment
A time period inside of an example that has a time dimension (e.g. video).
JSON representation | |
---|---|
{ "startTimeOffset": string, "endTimeOffset": string } |
Fields | |
---|---|
startTimeOffset |
Start of the time segment (inclusive), represented as the duration since the example start. A duration in seconds with up to nine fractional digits, terminated by ' |
endTimeOffset |
End of the time segment (exclusive), represented as the duration since the example start. A duration in seconds with up to nine fractional digits, terminated by ' |
VideoObjectTrackingAnnotation
Video object tracking annotation.
JSON representation | |
---|---|
{ "annotationSpec": { object ( |
Fields | |
---|---|
annotationSpec |
Label of the object tracked in this annotation. |
timeSegment |
The time segment of the video to which object tracking applies. |
objectTrackingFrames[] |
The list of frames where this object track appears. |
ObjectTrackingFrame
Video frame level annotation for object detection and tracking.
JSON representation | |
---|---|
{ "timeOffset": string, // Union field |
Fields | ||
---|---|---|
timeOffset |
The time offset of this frame relative to the beginning of the video. A duration in seconds with up to nine fractional digits, terminated by ' |
|
Union field bounded_area . The bounding box location of this object track for the frame. bounded_area can be only one of the following: |
||
boundingPoly |
|
|
normalizedBoundingPoly |
|
VideoEventAnnotation
Video event annotation.
JSON representation | |
---|---|
{ "annotationSpec": { object ( |
Fields | |
---|---|
annotationSpec |
Label of the event in this annotation. |
timeSegment |
The time segment of the video to which the annotation applies. |
AnnotationMetadata
Additional information associated with the annotation.
JSON representation | |
---|---|
{
"operatorMetadata": {
object ( |
Fields | |
---|---|
operatorMetadata |
Metadata related to human labeling. |
OperatorMetadata
General information useful for labels coming from contributors.
JSON representation | |
---|---|
{ "score": number, "totalVotes": number, "labelVotes": number, "comments": [ string ] } |
Fields | |
---|---|
score |
Confidence score corresponding to a label. For examle, if 3 contributors have answered the question and 2 of them agree on the final label, the confidence score will be 0.67 (2/3). |
totalVotes |
The total number of contributors that answer this question. |
labelVotes |
The total number of contributors that choose this label. |
comments[] |
Comments from contributors. |
AnnotationSentiment
Enums | |
---|---|
ANNOTATION_SENTIMENT_UNSPECIFIED |
|
NEGATIVE |
This annotation describes negatively about the data. |
POSITIVE |
This label describes positively about the data. |
Methods |
|
---|---|
|
Gets an example by resource name, including both data and annotation. |
|
Lists examples in an annotated dataset. |