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)
For our AI Hub's integrations with PySDK, you need to generate an access token.
In the navigation bar, click Tokens.
Click Generate New Token.
Provide a name for the token and optionally set an expiration date.
Set this token as an environment variable on your system. It'll give you access to the AI Hub whenever using @cloud.
Prevent abuse of your access token by keeping it private.
Last updated
Was this helpful?