Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
O SDK C++ é uma ferramenta disponível como parte do SDK da Vertex AI Vision. É possível usar o
SDK C++ para gerenciar, controlar e executar de maneira programática diferentes formas de
entrada/saída com a Vertex AI Vision.
Esta página descreve como usar o SDK C++ para criar e testar.
Use o tópico Criar streams e ingerir dados para
criar recursos de stream a serem usados nos exemplos de código a seguir.
Criar e testar programas
O exemplo a seguir mostra como usar o SDK de programação C++ para criar
seus próprios programas. O exemplo mostra esse processo diretamente, apresentando
um exemplo de envio e recebimento de Packets.
Estas instruções mostram como criar dois programas simples. O primeiro programa
envia mensagens em intervalos regulares, enquanto o segundo programa recebe as
mensagens que o primeiro programa envia. Você pode usar esses programas como ponto de partida
para criar seus próprios aplicativos personalizados com o SDK C++.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-09-01 UTC."],[],[],null,["# Build and test with the C++ SDK\n\nThe C++ SDK is a tool available as part of the Vertex AI Vision SDK. You can use the\nC++ SDK to programmatically manage, control, and perform different forms of\nI/O with Vertex AI Vision.\n\nThis page describes how to use the C++ SDK to build and test.\n\nBefore you begin\n----------------\n\n- Complete the steps to [set up your Google Cloud project](/vision-ai/docs/cloud-environment).\n- Review [system requirements](/vision-ai/docs/cloud-environment#cpp-supported-platforms) before trying to use the C++ SDK.\n- Get the Vertex AI Vision SDK source code from the publicly available\n [GitHub](https://github.com/google/visionai) repository:\n\n git clone https://github.com/google/visionai.git\n\n The C++ public SDK is located in `visionai/public/streams.h`. For reference\n information, see the [reference documentation](/vision-ai/docs/reference/cpp).\n- Install any [system dependencies](/vision-ai/docs/cloud-environment#cpp-system-deps) you might need.\n\n- Use the [create streams and ingest data](/vision-ai/docs/create-manage-streams) topic to\n create stream resources to use in the following code samples.\n\nBuild and test programs\n-----------------------\n\nThe following example shows you how to use the C++ programming SDK to build\nyour own programs. The sample shows this process directly by walking through\nan example for sending and receiving [`Packets`](/vision-ai/docs/reference/cpp/group/packet).\n\nThese instructions show you how to build two simple programs. The first program\nsends messages at regular intervals, while the second program receives the\nmessages that the first program sends. You can use these programs as a starting\npoint to build your own custom applications with the C++ SDK.\n\n1. Go to the root of the source code directory.\n\n The contents of the directory resemble the following: \n\n bazel BUILD CONTRIBUTING.md debian deps.bzl LICENSE README.md third_party visionai [...]\n\n2. Optional: Read the tutorial source code instructions.\n\n **Sender app:** \n\n cat visionai/public/tutorial/sender_app.cc\n\n **Receiver app:** \n\n cat visionai/public/tutorial/receiver_app.cc\n\n3. Build the sender and receiver apps.\n\n bazel build //visionai/public/tutorial/...\n\n4. Verify the build worked. In one terminal, run the following command for the\n sender app. Replace the following:\n\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n - \u003cvar translate=\"no\"\u003eLOCATION_ID\u003c/var\u003e: Your location ID. For example, `us-central1`. [Supported regions](/vision-ai/docs/warehouse-supported-regions). [More information](/about/locations).\n - \u003cvar translate=\"no\"\u003eSTREAM_ID\u003c/var\u003e: The stream ID that you created in the cluster. For example, `input-1`.\n\n ```\n ./bazel-bin/visionai/public/tutorial/sender_app \\\n --service_endpoint visionai.googleapis.com \\\n --project_id PROJECT_ID \\\n --location_id LOCATION_ID \\\n --cluster_id application-cluster-0 \\\n --stream_id STREAM_ID\n ```\n5. In a different terminal, run the following command for the\n receiver app. Replace the following:\n\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your project ID.\n - \u003cvar translate=\"no\"\u003eLOCATION_ID\u003c/var\u003e: Your location ID. For example, `us-central1`. [Supported regions](/vision-ai/docs/warehouse-supported-regions). [More information](/about/locations).\n - \u003cvar translate=\"no\"\u003eSTREAM_ID\u003c/var\u003e: The stream ID that you created in the cluster. For example, `input-1`.\n\n ```\n ./bazel-bin/visionai/public/tutorial/receiver_app \\\n --service_endpoint visionai.googleapis.com \\\n --project_id PROJECT_ID \\\n --location_id LOCATION_ID \\\n --cluster_id application-cluster-0 \\\n --stream_id STREAM_ID\n ```\n\nWhat's next\n-----------\n\n- Read about processing components you can add to an app in [Build an app](/vision-ai/docs/build-app).\n- Learn about output storage and processing options in [Connect app output to a data destination](/vision-ai/docs/connect-data-destination).\n- Read about how to [Search Warehouse data in the console](/vision-ai/docs/search-streaming-warehouse)."]]