REST Resource: projects.locations.corpora.assets.annotations

Resource: Annotation

An annotation is a resource in asset. It represents a key-value mapping of content in asset.

JSON representation
{
  "name": string,
  "userSpecifiedAnnotation": {
    object (UserSpecifiedAnnotation)
  }
}
Fields
name

string

Resource name of the annotation. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}

userSpecifiedAnnotation

object (UserSpecifiedAnnotation)

User provided annotation.

UserSpecifiedAnnotation

Annotation provided by users.

JSON representation
{
  "key": string,
  "value": {
    object (AnnotationValue)
  },
  "partition": {
    object (Partition)
  }
}
Fields
key

string

Required. Key of the annotation. The key must be set with type by CreateDataSchema.

value

object (AnnotationValue)

Value of the annotation. The value must be able to convert to the type according to the data schema.

partition

object (Partition)

Partition information in time and space for the sub-asset level annotation.

AnnotationValue

Value of annotation, including all types available in data schema.

JSON representation
{

  // Union field value can be only one of the following:
  "intValue": string,
  "floatValue": number,
  "strValue": string,
  "datetimeValue": string,
  "geoCoordinate": {
    object (GeoCoordinate)
  },
  "protoAnyValue": {
    "@type": string,
    field1: ...,
    ...
  },
  "boolValue": boolean,
  "customizedStructDataValue": {
    object
  },
  "listValue": {
    object (AnnotationList)
  },
  "customizedStructValue": {
    object (AnnotationCustomizedStruct)
  }
  // End of list of possible types for union field value.
}
Fields

Union field value.

value can be only one of the following:

intValue

string (int64 format)

Value of int type annotation.

floatValue

number

Value of float type annotation.

strValue

string

Value of string type annotation.

datetimeValue

string

Value of date time type annotation.

geoCoordinate

object (GeoCoordinate)

Value of geo coordinate type annotation.

protoAnyValue

object

Value of any proto value.

An object containing fields of an arbitrary type. An additional field "@type" contains a URI identifying the type. Example: { "id": 1234, "@type": "types.example.com/standard/id" }.

boolValue

boolean

Value of boolean type annotation.

customizedStructDataValue

object (Struct format)

Value of customized struct annotation. This field does not have effects. Use customizedStructValue instead for customized struct annotation.

listValue

object (AnnotationList)

Value of list type annotation.

customizedStructValue

object (AnnotationCustomizedStruct)

Value of custom struct type annotation.

GeoCoordinate

Location Coordinate Representation

JSON representation
{
  "latitude": number,
  "longitude": number
}
Fields
latitude

number

Latitude Coordinate. Degrees [-90 .. 90]

longitude

number

Longitude Coordinate. Degrees [-180 .. 180]

AnnotationList

List representation in annotation.

JSON representation
{
  "values": [
    {
      object (AnnotationValue)
    }
  ]
}
Fields
values[]

object (AnnotationValue)

The values of LIST data type annotation.

AnnotationCustomizedStruct

Customized struct represnation in annotation.

JSON representation
{
  "elements": {
    string: {
      object (AnnotationValue)
    },
    ...
  }
}
Fields
elements

map (key: string, value: object (AnnotationValue))

A map from elements' keys to element's annotation value.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

Partition

Partition to specify the partition in time and space for sub-asset level annotation.

JSON representation
{
  "temporalPartition": {
    object (TemporalPartition)
  },
  "spatialPartition": {
    object (SpatialPartition)
  },
  "relativeTemporalPartition": {
    object (RelativeTemporalPartition)
  }
}
Fields
temporalPartition

object (TemporalPartition)

Partition of asset in time.

spatialPartition

object (SpatialPartition)

Partition of asset in space.

relativeTemporalPartition

object (RelativeTemporalPartition)

Partition of asset in time.

TemporalPartition

Partition of asset in UTC Epoch time. Supported by STREAM_VIDEO corpus type.

JSON representation
{
  "startTime": string,
  "endTime": string
}
Fields
startTime

string (Timestamp format)

Start time of the partition.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

endTime

string (Timestamp format)

End time of the partition.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

SpatialPartition

Partition of asset in space.

JSON representation
{
  "xMin": string,
  "yMin": string,
  "xMax": string,
  "yMax": string
}
Fields
xMin

string (int64 format)

The minimum x coordinate value.

yMin

string (int64 format)

The minimum y coordinate value.

xMax

string (int64 format)

The maximum x coordinate value.

yMax

string (int64 format)

The maximum y coordinate value.

RelativeTemporalPartition

Partition of asset in relative time. Supported by VIDEO_ON_DEMAND corpus type.

JSON representation
{
  "startOffset": string,
  "endOffset": string
}
Fields
startOffset

string (Duration format)

Start time offset of the partition.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

endOffset

string (Duration format)

End time offset of the partition.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

Methods

create

Creates annotation inside asset.

delete

Deletes annotation inside asset.

get

Reads annotation inside asset.

list

Lists a list of annotations inside asset.

patch

Updates annotation inside asset.