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. You can set it to "@cloud" to use DeGirum’s cloud-hosted hardware—no local setup required.

Example PySDK Code

The snippet below connects to the remote device farm and runs inference on an image hosted on DeGirum's PySDK Examples GitHub repository.

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("https://raw.githubusercontent.com/DeGirum/PySDKExamples/main/images/bikes.jpg")

# Print raw results
print(result)

Last updated

Was this helpful?