ApplicationConfigs

用于存储应用图表的消息。

JSON 表示法
{
  "nodes": [
    {
      object (Node)
    }
  ]
}
字段
nodes[]

object (Node)

应用图中的节点列表。

节点

用于描述节点对象的消息。

JSON 表示法
{
  "name": string,
  "displayName": string,
  "nodeConfig": {
    object (ProcessorConfig)
  },
  "processor": string,
  "parents": [
    {
      object (InputEdge)
    }
  ],

  // Union field stream_output_config can be only one of the following:
  "outputAllOutputChannelsToStream": boolean
  // End of list of possible types for union field stream_output_config.
}
字段
name

string

必需。节点的唯一名称。

displayName

string

节点的易记显示名称。

nodeConfig

object (ProcessorConfig)

节点配置。

processor

string

处理器名称是指所选的处理器资源。

parents[]

object (InputEdge)

父节点。输入节点不应具有父节点。对于 V1 Alpha1/Beta 版,只有媒体仓库节点可以有多个父级,其他类型的节点只能有一个父级。

联合字段 stream_output_config

stream_output_config 只能是下列其中一项:

outputAllOutputChannelsToStream

boolean

默认情况下,节点的输出仅可供下游节点使用。如需使用应用节点的直接输出,必须先将输出发送到 Vision AI Streams。

通过将 outputAllOutputChannelsToStream 设置为 true,App Platform 会自动将当前节点的所有输出发送到 Vision AI 数据流资源(每个输出通道一个数据流)。输出流资源将由 App Platform 在部署期间自动创建,并在应用取消部署后删除。请注意,此配置适用于所有应用实例。

您可以通过配置实例资源的 outputResources 部分,在实例级别替换输出流。producerNode 应为当前节点,outputResourceBinding 应为输出通道名称(如果处理器只有 1 个输出通道,则将其留空),outputResource 应为目标输出串流。

ProcessorConfig

下一个 ID:28

JSON 表示法
{

  // Union field processor_config can be only one of the following:
  "videoStreamInputConfig": {
    object (VideoStreamInputConfig)
  },
  "aiEnabledDevicesInputConfig": {
    object (AIEnabledDevicesInputConfig)
  },
  "mediaWarehouseConfig": {
    object (MediaWarehouseConfig)
  },
  "personBlurConfig": {
    object (PersonBlurConfig)
  },
  "occupancyCountConfig": {
    object (OccupancyCountConfig)
  },
  "personVehicleDetectionConfig": {
    object (PersonVehicleDetectionConfig)
  },
  "vertexAutomlVisionConfig": {
    object (VertexAutoMLVisionConfig)
  },
  "vertexAutomlVideoConfig": {
    object (VertexAutoMLVideoConfig)
  },
  "vertexCustomConfig": {
    object (VertexCustomConfig)
  },
  "generalObjectDetectionConfig": {
    object (GeneralObjectDetectionConfig)
  },
  "bigQueryConfig": {
    object (BigQueryConfig)
  },
  "personalProtectiveEquipmentDetectionConfig": {
    object (PersonalProtectiveEquipmentDetectionConfig)
  }
  // End of list of possible types for union field processor_config.
}
字段

联合字段 processor_config

processor_config 只能是下列其中一项:

videoStreamInputConfig

object (VideoStreamInputConfig)

数据流输入处理器的配置。

aiEnabledDevicesInputConfig

object (AIEnabledDevicesInputConfig)

支持 AI 的输入设备的配置。

mediaWarehouseConfig

object (MediaWarehouseConfig)

媒体仓库处理器的配置。

personBlurConfig

object (PersonBlurConfig)

人像模糊处理器的配置。

occupancyCountConfig

object (OccupancyCountConfig)

入住人数统计处理器的配置。

personVehicleDetectionConfig

object (PersonVehicleDetectionConfig)

人员车辆检测处理器的配置。

vertexAutomlVisionConfig

object (VertexAutoMLVisionConfig)

Vertex AutoML Vision 处理器的配置。

vertexAutomlVideoConfig

object (VertexAutoMLVideoConfig)

Vertex AutoML 视频处理器的配置。

vertexCustomConfig

object (VertexCustomConfig)

Vertex 自定义处理器的配置。

generalObjectDetectionConfig

object (GeneralObjectDetectionConfig)

常规对象检测处理器的配置。

bigQueryConfig

object (BigQueryConfig)

BigQuery 处理器的配置。

personalProtectiveEquipmentDetectionConfig

object (PersonalProtectiveEquipmentDetectionConfig)

personalProtectiveEquipmentDetectionConfig 的配置

VideoStreamInputConfig

用于描述视频流输入配置的消息。此消息应仅用作 builtin:stream-input 处理器的占位符,实际的流绑定应使用相应的 API 指定。

JSON 表示法
{
  "streams": [
    string
  ],
  "streamsWithAnnotation": [
    {
      object (StreamWithAnnotation)
    }
  ]
}
字段
streams[]
(deprecated)

string

streamsWithAnnotation[]
(deprecated)

object (StreamWithAnnotation)

AIEnabledDevicesInputConfig

消息,介绍了支持 AI 的设备输入配置。

MediaWarehouseConfig

用于描述 MediaWarehouseConfig 的消息。

JSON 表示法
{
  "corpus": string,
  "region": string,
  "ttl": string
}
字段
corpus

string

Media Warehouse 语料库的资源名称。格式:projects/${projectId}/locations/${locationId}/corpora/${corpus_id}

region
(deprecated)

string

已弃用。

ttl

string (Duration format)

所有媒体资产、关联的元数据和搜索文档的有效期。

该时长以秒为单位,最多包含九个小数位,以“s”结尾。示例:"3.5s"

PersonBlurConfig

用于描述 FaceBlurConfig 的消息。

JSON 表示法
{
  "personBlurType": enum (PersonBlurType),
  "facesOnly": boolean
}
字段
personBlurType

enum (PersonBlurType)

人物模糊处理类型。

facesOnly

boolean

是否仅在处理器中模糊处理人脸,而不模糊处理整个对象。

PersonBlurType

人物模糊处理类型

枚举
PERSON_BLUR_TYPE_UNSPECIFIED 人脸模糊处理类型为“UNSPECIFIED”。
FULL_OCCULUSION 脸部模糊处理类型:完全遮盖。
BLUR_FILTER FaceBlur 类型模糊处理滤镜。

OccupancyCountConfig

用于说明 OccupancyCountConfig 的消息。

JSON 表示法
{
  "enablePeopleCounting": boolean,
  "enableVehicleCounting": boolean,
  "enableDwellingTimeTracking": boolean
}
字段
enablePeopleCounting

boolean

无论是统计人物出镜次数,还是输出统计次数,键均为“people”。

enableVehicleCounting

boolean

无论是否要统计车辆出现次数,输出计数都将使用“vehicle”作为键。

enableDwellingTimeTracking

boolean

是否跟踪每个个别对象在场景或特定区域内的逗留时间。

PersonVehicleDetectionConfig

用于描述 PersonVehicleDetectionConfig 的消息。

JSON 表示法
{
  "enablePeopleCounting": boolean,
  "enableVehicleCounting": boolean
}
字段
enablePeopleCounting

boolean

enablePeopleCounting 和 enableVehicleCounting 字段中至少有一个必须设置为 true。无论是统计人物出镜次数,还是输出统计次数,键均为“people”。

enableVehicleCounting

boolean

无论是否要统计车辆出现次数,输出计数都将使用“vehicle”作为键。

VertexAutoMLVisionConfig

Vertex AutoML Vision 处理器配置消息。

JSON 表示法
{
  "confidenceThreshold": number,
  "maxPredictions": integer
}
字段
confidenceThreshold

number

系统将仅返回得分高于阈值的实体。值 0.0 表示返回所有检测到的实体。

maxPredictions

integer

每个输出帧最多可返回这么多预测。值 0 表示返回所有检测到的实体。

VertexAutoMLVideoConfig

用于描述 VertexAutoMLVideoConfig 的消息。

JSON 表示法
{
  "confidenceThreshold": number,
  "blockedLabels": [
    string
  ],
  "maxPredictions": integer,
  "boundingBoxSizeLimit": number
}
字段
confidenceThreshold

number

系统将仅返回得分高于阈值的实体。值 0.0 表示返回所有检测到的实体。

blockedLabels[]

string

系统不会返回此字段中指定的标签。

maxPredictions

integer

每个输出帧最多可返回这么多预测。值 0 表示返回所有检测到的实体。

boundingBoxSizeLimit

number

系统只会返回大小大于此上限的边界框。仅限对象跟踪。值 0.0 表示返回所有检测到的实体。

VertexCustomConfig

用于描述 VertexCustomConfig 的消息。

JSON 表示法
{
  "maxPredictionFps": integer,
  "dedicatedResources": {
    object (DedicatedResources)
  },
  "postProcessingCloudFunction": string,
  "attachApplicationMetadata": boolean
}
字段
maxPredictionFps

integer

每秒最大预测帧数。此属性用于设置运算符向 Vertex AI 端点发送预测请求的速度。默认值为 0,表示没有预测 FPS 上限。运营商以输入 fps 发送预测请求。

dedicatedResources

object (DedicatedResources)

专门用于 DeployedModel 且需要更高程度的手动配置的资源的说明。

postProcessingCloudFunction

string

如果不为空,系统会将预测结果发送到指定的 Cloud Functions 函数进行后处理。* Cloud Functions 函数将收到 AppPlatformCloudFunctionRequest,其中 annotations 字段将采用 proto PredictResponse 的 JSON 格式。* Cloud Functions 函数应返回 AppPlatformCloudFunctionResponse,并将 PredictResponse 存储在 annotations 字段中。* 如需丢弃预测输出,只需清除返回的 AppPlatformCloudFunctionResponse 中的载荷字段即可。

attachApplicationMetadata

boolean

如果为 true,自定义模型收到的预测请求还将包含采用以下架构的元数据:'appPlatformMetadata': { 'ingestionTime': DOUBLE; (UNIX timestamp) 'application': STRING; 'instanceId': STRING; 'node': STRING; 'processor': STRING; }

DedicatedResources

专用于 DeployedModel 且需要更高程度的手动配置的资源的说明。

JSON 表示法
{
  "machineSpec": {
    object (MachineSpec)
  },
  "minReplicaCount": integer,
  "maxReplicaCount": integer,
  "autoscalingMetricSpecs": [
    {
      object (AutoscalingMetricSpec)
    }
  ]
}
字段
machineSpec

object (MachineSpec)

必需。不可变。预测所使用的单个机器的规范。

minReplicaCount

integer

必需。不可变。始终在其中部署此 DeployedModel 的机器副本的数量下限。此值必须大于或等于 1。

如果 DeployedModel 的流量增加,系统可能会将其动态部署到更多副本上,而随着流量减少,系统可能会释放其中一些额外的副本。

maxReplicaCount

integer

不可变。当相应 DeployedModel 的流量增加时,可在其中部署的副本数量上限。如果请求的值过大,部署将出错,但如果部署成功,则可以保证将模型扩缩到该数量的副本(除非服务中断)。如果 DeployedModel 的流量超出其副本的最大处理能力,系统会丢弃部分流量。如果未提供此值,则将使用 minReplicaCount 作为默认值。

此字段的值会影响 Vertex CPU 和 GPU 配额的费用。具体而言,您需要按以下费率付费:(maxReplicaCount * 所选机器类型中的核心数量) 和 (maxReplicaCount * 所选机器类型中每个副本的 GPU 数量)。

autoscalingMetricSpecs[]

object (AutoscalingMetricSpec)

不可变。用于替换资源利用率指标(CPU 利用率、加速器的占空百分比等)目标值的指标规范(如果未设置,则默认为 60)。每个指标最多只能有一个条目。

如果 machineSpec.accelerator_count 大于 0,则自动扩缩将同时基于 CPU 利用率和加速器的占空百分比指标进行,当任一指标超出其目标值时,系统会进行扩容;如果两个指标均低于其目标值,则系统会进行缩容。这两个指标的默认目标值均为 60。

如果 machineSpec.accelerator_count 为 0,则自动扩缩将仅基于 CPU 利用率指标(如果未明确设置,则默认目标值为 60)进行。

例如,在线预测情况下,如果您想将目标 CPU 利用率替换为 80,则应将 autoscalingMetricSpecs.metric_name 设置为 aiplatform.googleapis.com/prediction/online/cpu/utilization,并将 autoscalingMetricSpecs.target 设置为 80

MachineSpec

单台机器的规范。

JSON 表示法
{
  "machineType": string,
  "acceleratorType": enum (AcceleratorType),
  "acceleratorCount": integer
}
字段
machineType

string

不可变。机器的类型。

查看支持预测的机器类型列表

请参阅支持自定义训练的机器类型列表

对于 [DeployedModel][],此字段是可选字段,默认值为 n1-standard-2。对于 [BatchPredictionJob][] 或 [WorkerPoolSpec][] 的一部分,此字段是必填字段。

acceleratorType

enum (AcceleratorType)

不可变。根据 acceleratorCount 可能挂接到机器的加速器类型。

acceleratorCount

integer

要挂接到机器的加速器数量。

AcceleratorType

表示硬件加速器类型。

枚举
ACCELERATOR_TYPE_UNSPECIFIED 未指定的加速器类型,即无加速器。
NVIDIA_TESLA_K80 Nvidia Tesla K80 GPU。
NVIDIA_TESLA_P100 Nvidia Tesla P100 GPU。
NVIDIA_TESLA_V100 Nvidia Tesla V100 GPU。
NVIDIA_TESLA_P4 Nvidia Tesla P4 GPU。
NVIDIA_TESLA_T4 Nvidia Tesla T4 GPU。
NVIDIA_TESLA_A100 Nvidia Tesla A100 GPU。
TPU_V2 TPU v2。
TPU_V3 TPU v3。

AutoscalingMetricSpec

用于定义目标资源利用率(CPU 利用率、加速器的工作周期等)的指标规范,以便计算所需的副本数。

JSON 表示法
{
  "metricName": string,
  "target": integer
}
字段
metricName

string

必需。资源指标名称。支持的指标:

  • 对于在线预测:
  • aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle
  • aiplatform.googleapis.com/prediction/online/cpu/utilization
target

integer

给定指标的目标资源利用率(以百分比 [1% -100%] 表示);一旦实际使用率与目标值偏差超过一定百分比,机器副本就会发生变化。如果未提供,则默认值为 60(表示 60%)。

GeneralObjectDetectionConfig

通用对象检测处理器的配置消息。

BigQueryConfig

BigQuery 处理器的配置消息。

JSON 表示法
{
  "table": string,
  "cloudFunctionMapping": {
    string: string,
    ...
  },
  "createDefaultTableIfNotExists": boolean
}
字段
table

string

用于将注释提取到 Vision AI Platform 的 BigQuery 表资源。

cloudFunctionMapping

map (key: string, value: string)

数据架构:默认情况下,Vision AI 应用会尝试使用以下架构将注释写入目标 BigQuery 表:

ingestion_time:TIMESTAMP,原始数据的提取时间。

application:STRING,生成注解的应用的名称。

instance:STRING,生成注解的实例的 ID。

node:STRING,生成注解的应用图节点的名称。

annotation:STRING 或 JSON,实际注释 protobuf 将转换为 json 字符串,其中 bytes 字段为 base64 编码的字符串。它可以写入字符串或 Json 类型的列。

如需将注释数据转发到现有 BigQuery 表,客户需要确保架构的兼容性。该映射将应用节点名称映射到其对应的 Cloud Functions 端点,以便将注释直接转换为 google.cloud.bigquery.storage.v1.AppendRowsRequest(应仅设置 avro_rows 或 proto_rows)。如果已配置,相应应用节点生成的注释将先发送到 Cloud Functions,然后再转发到 BigQuery。

如果默认表架构不适用,客户可以使用 CloudFunction 将注释输出从 Vision AI 应用转换为任意 BigQuery 表架构。* Cloud Functions 函数将收到 AppPlatformCloudFunctionRequest,其中 annotations 字段将采用 Vision AI 注释的 JSON 格式。* Cloud 函数应返回 AppPlatformCloudFunctionResponse,并将 AppendRowsRequest 存储在 annotations 字段中。* 如需删除注释,只需清除返回的 AppPlatformCloudFunctionResponse 中的 annotations 字段即可。

包含一系列 "key": value 对的对象。示例:{ "name": "wrench", "mass": "1.3kg", "count": "3" }

createDefaultTableIfNotExists

boolean

如果为 true,则当指定表不存在时,App Platform 将使用默认架构创建 BigQuery DataSet 和 BigQuery 表。如果指定了任何 Cloud Functions 自定义架构,则此方法不起作用,因为系统不知道您想要的架构。JSON 列将用于 App Platform 创建的默认表。

PersonalProtectiveEquipmentDetectionConfig

用于描述 PersonalProtectiveEquipmentDetectionConfig 的消息。

JSON 表示法
{
  "enableFaceCoverageDetection": boolean,
  "enableHeadCoverageDetection": boolean,
  "enableHandsCoverageDetection": boolean
}
字段
enableFaceCoverageDetection

boolean

是否启用人脸遮挡检测。

enableHeadCoverageDetection

boolean

是否启用头部遮盖检测。

enableHandsCoverageDetection

boolean

是否启用手掌覆盖检测。

InputEdge

消息,用于描述指向某个节点的边。

JSON 表示法
{
  "parentNode": string,
  "parentOutputChannel": string,
  "connectedInputChannel": string
}
字段
parentNode

string

父节点的名称。

parentOutputChannel

string

父节点的已连接输出工件。如果目标处理器只有 1 个输出工件,则可以省略此属性。

connectedInputChannel

string

当前节点处理器的已连接输入通道。如果目标处理器只有 1 个输入通道,则可以忽略此参数。