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
- Complete the steps to set up your Google Cloud project.
- Review system requirements before trying to use the C++ SDK.
Get the Vertex AI Vision SDK source code from the publicly available GitHub repository:
git clone https://github.com/google/visionai.git
The C++ public SDK is located in
visionai/public/streams.h
. For reference information, see the reference documentation.Install any system dependencies you might need.
Use the create streams and ingest data topic to create stream resources to use in the following code samples.
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.
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 [...]
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
Build the sender and receiver apps.
bazel build //visionai/public/tutorial/...
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
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
- Read about processing components you can add to an app in Build an app.
- Learn about output storage and processing options in Connect app output to a data destination .
- Read about how to Search Warehouse data in the console.