Build and test with the C++ SDK

The C++ SDK is a tool available as part of the Vertex AI Vision SDK. You can use the C++ SDK to programmatically manage, control, and perform different forms of I/O with Vertex AI Vision.

This page describes how to use the C++ SDK to build and test.

Before you begin

Build and test programs

The following example shows you how to use the C++ programming SDK to build your own programs. The sample shows this process directly by walking through an example for sending and receiving Packets.

These instructions show you how to build two simple programs. The first program sends messages at regular intervals, while the second program receives the messages that the first program sends. You can use these programs as a starting point to build your own custom applications with the C++ SDK.

  1. Go to the root of the source code directory.

    The contents of the directory resemble the following:

    bazel  BUILD  CONTRIBUTING.md  debian  deps.bzl  LICENSE  README.md  third_party  visionai [...]
    
  2. Optional: Read the tutorial source code instructions.

    Sender app:

    cat visionai/public/tutorial/sender_app.cc
    

    Receiver app:

    cat visionai/public/tutorial/receiver_app.cc
    
  3. Build the sender and receiver apps.

    bazel build //visionai/public/tutorial/...
    
  4. Verify the build worked. In one terminal, run the following command for the sender app. Replace the following:

    • PROJECT_ID: Your project ID.
    • LOCATION_ID: Your location ID. For example, us-central1. Supported regions. More information.
    • STREAM_ID: The stream ID that you created in the cluster. For example, input-1.
    ./bazel-bin/visionai/public/tutorial/sender_app \
    --service_endpoint visionai.googleapis.com \
    --project_id PROJECT_ID \
    --location_id LOCATION_ID \
    --cluster_id application-cluster-0 \
    --stream_id STREAM_ID
  5. In a different terminal, run the following command for the receiver app. Replace the following:

    • PROJECT_ID: Your project ID.
    • LOCATION_ID: Your location ID. For example, us-central1. Supported regions. More information.
    • STREAM_ID: The stream ID that you created in the cluster. For example, input-1.
    ./bazel-bin/visionai/public/tutorial/receiver_app \
    --service_endpoint visionai.googleapis.com \
    --project_id PROJECT_ID \
    --location_id LOCATION_ID \
    --cluster_id application-cluster-0 \
    --stream_id STREAM_ID

What's next