PySDK Integration

Integrate DeGirum PySDK with AI Hub to keep your code concise while tapping into powerful cloud-hosted inference across diverse hardware resources.

DeGirum PySDK integrates with the AI Hub so you can write compact, easy-to-understand code. The inference_host_address parameter tells PySDK where to run your model. Set it to "@cloud" to use DeGirum’s cloud-hosted hardware—no local setup required.

Example Code

The snippet below connects to the remote device farm and runs inference on a local image file.

import degirum as dg

# Connect to the AI Hub
inference_manager = dg.connect(
    inference_host_address = "@cloud",
    zoo_url = "degirum/degirum",
    token = "<your_token>"
)

# Load a model. In this case, an image detection model from degirum/degirum.
model = inference_manager.load_model("yolov8n_relu6_coco--640x640_quant_n2x_orca1_1")

# Run inference on an image
result = model("<your_image>")

# Print raw results
print(result)

You need an access token to connect to the device farm and the model zoo.

For our AI Hub's integrations with PySDK, you need to generate an access token.

1

In the navigation bar, click Tokens.

2

Click Generate New Token.

3

Provide a name for the token and optionally set an expiration date.

4

Set this token as an environment variable on your system. It'll give you access to the AI Hub whenever using @cloud.

Last updated

Was this helpful?