# StreamWithAnnotation

- [JSON representation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#SCHEMA_REPRESENTATION)
- [StreamAnnotation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#StreamAnnotation)
  - [JSON representation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#StreamAnnotation.SCHEMA_REPRESENTATION)
- [NormalizedPolygon](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#NormalizedPolygon)
  - [JSON representation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#NormalizedPolygon.SCHEMA_REPRESENTATION)
- [NormalizedVertex](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#NormalizedVertex)
  - [JSON representation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#NormalizedVertex.SCHEMA_REPRESENTATION)
- [NormalizedPolyline](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#NormalizedPolyline)
  - [JSON representation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#NormalizedPolyline.SCHEMA_REPRESENTATION)
- [NodeAnnotation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#NodeAnnotation)
  - [JSON representation](https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#NodeAnnotation.SCHEMA_REPRESENTATION)

Message describing Vision AI stream with application specific annotations. All the StreamAnnotation object inside this message MUST have unique id.

| JSON representation |
|---|
| ``` { "stream": string, "applicationAnnotations": [ { object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#StreamAnnotation`) } ], "nodeAnnotations": [ { object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#NodeAnnotation`) } ] } ``` |

| Fields ||
|---|---|
| `stream` | `string` Vision AI Stream resource name. |
| `applicationAnnotations[]` | ``object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#StreamAnnotation`)`` Annotations that will be applied to the whole application. |
| `nodeAnnotations[]` | ``object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#NodeAnnotation`)`` Annotations that will be applied to the specific node of the application. If the same type of the annotations is applied to both application and node, the node annotation will be added in addition to the global application one. For example, if there is one active zone annotation for the whole application and one active zone annotation for the Occupancy Analytic processor, then the Occupancy Analytic processor will have two active zones defined. |

## StreamAnnotation

message about annotations about Vision AI stream resource.

| JSON representation |
|---|
| ``` { "id": string, "displayName": string, "sourceStream": string, "type": enum (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamAnnotationType`), // Union field `annotation_payload` can be only one of the following: "activeZone": { object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#NormalizedPolygon`) }, "crossingLine": { object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#NormalizedPolyline`) } // End of list of possible types for union field `annotation_payload`. } ``` |

| Fields ||
|---|---|
| `id` | `string` ID of the annotation. It must be unique when used in the certain context. For example, all the annotations to one input streams of a Vision AI application. |
| `displayName` | `string` User-friendly name for the annotation. |
| `sourceStream` | `string` The Vision AI stream resource name. |
| `type` | ``enum (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamAnnotationType`)`` The actual type of Annotation. |
| Union field `annotation_payload`. `annotation_payload` can be only one of the following: ||
| `activeZone` | ``object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#NormalizedPolygon`)`` Annotation for type ACTIVE_ZONE |
| `crossingLine` | ``object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#NormalizedPolyline`)`` Annotation for type CROSSING_LINE |

## NormalizedPolygon

Normalized Polygon.

| JSON representation |
|---|
| ``` { "normalizedVertices": [ { object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#NormalizedVertex`) } ] } ``` |

| Fields ||
|---|---|
| `normalizedVertices[]` | ``object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#NormalizedVertex`)`` The bounding polygon normalized vertices. Top left corner of the image will be \[0, 0\]. |

## 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` | `number` X coordinate. |
| `y` | `number` Y coordinate. |

## NormalizedPolyline

Normalized Pplyline, which represents a curve consisting of connected straight-line segments.

| JSON representation |
|---|
| ``` { "normalizedVertices": [ { object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#NormalizedVertex`) } ] } ``` |

| Fields ||
|---|---|
| `normalizedVertices[]` | ``object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#NormalizedVertex`)`` A sequence of vertices connected by straight lines. |

## NodeAnnotation

Message describing annotations specific to application node.

| JSON representation |
|---|
| ``` { "node": string, "annotations": [ { object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#StreamAnnotation`) } ] } ``` |

| Fields ||
|---|---|
| `node` | `string` The node name of the application graph. |
| `annotations[]` | ``object (`https://docs.cloud.google.com/vision-ai/docs/reference/rest/v1alpha1/StreamWithAnnotation#StreamAnnotation`)`` The node specific stream annotations. |