Method: projects.locations.models.predict

Stay organized with collections Save and categorize content based on your preferences.

Not used for AutoML Video Intelligence Object Tracking.

HTTP request

POST https://automl.googleapis.com/v1beta1/{name}:predict

Path parameters

Parameters
name

string

Name of the model requested to serve the prediction.

Authorization requires the following Google IAM permission on the specified resource name:

  • automl.models.predict

Request body

The request body contains data with the following structure:

JSON representation
{
  "payload": {
    object(ExamplePayload)
  },
  "params": {
    string: string,
    ...
  }
}
Fields
payload

object(ExamplePayload)

Required. Payload to perform a prediction on. The payload must match the problem type that the model was trained to solve.

params

map (key: string, value: string)

Additional domain-specific parameters, any string must be up to 25000 characters long.

Response body

If successful, the response body contains data with the following structure:

Response message for PredictionService.Predict.

JSON representation
{
  "payload": [
    {
      object(AnnotationPayload)
    }
  ],
  "metadata": {
    string: string,
    ...
  }
}
Fields
payload[]

object(AnnotationPayload)

Prediction result.

metadata

map (key: string, value: string)

Additional domain-specific prediction response metadata.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

ExamplePayload

Example data used for training or prediction.

AnnotationPayload

Contains annotation information that is relevant to AutoML.

JSON representation
{
  "annotationSpecId": string,
  "displayName": string,

  // Union field detail can be only one of the following:
  "classification": {
    object(ClassificationAnnotation)
  },
  "videoObjectTracking": {
    object(VideoObjectTrackingAnnotation)
  }
  // End of list of possible types for union field detail.
}
Fields
annotationSpecId

string

Output only . The resource ID of the annotation spec that this annotation pertains to. The annotation spec comes from either an ancestor dataset, or the dataset that was used to train the model in use.

displayName

string

Output only. The value of displayName when the model was trained. Because this field returns a value at model training time, for different models trained using the same dataset, the returned value could be different as model owner could update the displayName between any two model training.

Union field detail. Output only . Additional information about the annotation specific to the AutoML domain. detail can be only one of the following:
classification

object(ClassificationAnnotation)

Not used for AutoML Video Intelligence Object Tracking.

videoObjectTracking

object(VideoObjectTrackingAnnotation)

Annotation details for object tracking predictions.

ClassificationAnnotation

Contains annotation details specific to classification.

JSON representation
{
  "score": number
}
Fields
score

number

Output only. A confidence estimate between 0.0 and 1.0. A higher value means greater confidence that the annotation is positive. If a user approves an annotation as negative or positive, the score value remains unchanged. If a user creates an annotation, the score is 0 for negative or 1 for positive.

VideoObjectTrackingAnnotation

Annotation details for video object tracking.

JSON representation
{
  "instanceId": string,
  "timeOffset": string,
  "boundingBox": {
    object(BoundingPoly)
  },
  "score": number
}
Fields
instanceId

string

Optional. The instance of the object, expressed as a positive integer. Used to tell apart objects of the same type (i.e. AnnotationSpec) when multiple are present on a single example. NOTE: Instance ID prediction quality is not a part of model evaluation and is done as best effort. Especially in cases when an entity goes off-screen for a longer time (minutes), when it comes back it may be given a new instance ID.

timeOffset

string (Duration format)

Required. A time (frame) of a video to which this annotation pertains. Represented as the duration since the video's start.

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

boundingBox

object(BoundingPoly)

Required. The rectangle representing the object location on the frame (i.e. at the timeOffset of the video).

score

number

Output only. The confidence that this annotation is positive for the video at the timeOffset, value in [0, 1], higher means higher positivity confidence. For annotations created by the user the score is 1. When user approves an annotation, the original float score is kept (and not changed to 1).

BoundingPoly

A bounding polygon of a detected object on a plane. On output both vertices and normalizedVertices are provided. The polygon is formed by connecting vertices in the order they are listed.

JSON representation
{
  "normalizedVertices": [
    {
      object(NormalizedVertex)
    }
  ]
}
Fields
normalizedVertices[]

object(NormalizedVertex)

Output only . The bounding polygon normalized vertices.

NormalizedVertex

A vertex represents a 2D point in the image. The normalized vertex coordinates are between 0 to 1 fractions relative to the original plane (image, video). E.g. if the plane (e.g. whole image) would have size 10 x 20 then a point with normalized coordinates (0.1, 0.3) would be at the position (1, 6) on that plane.

JSON representation
{
  "x": number,
  "y": number
}
Fields
x

number

Required. Horizontal coordinate.

y

number

Required. Vertical coordinate.