### Create and Install Token via CLI (Self-Service) Source: https://docs.degirum.com/pysdk/token-installation-and-management Initiates a self-service enrollment process for developer-managed fleets. The CLI guides the user through authentication and installs the token locally. ```bash degirum token create ``` -------------------------------- ### Install OpenVINO Runtime via CLI Source: https://docs.degirum.com/pysdk/release-notes Install the OpenVINO runtime on Windows using the `degirum install-runtime` command. Administrator privileges may be required for installation in shared directories. ```bash degirum install-runtime openvino ``` -------------------------------- ### Query Documentation API Example Source: https://docs.degirum.com/pysdk/quickstart To get additional information not directly on the page, make an HTTP GET request to the page URL with the 'ask' query parameter. The question should be specific and in natural language. ```http GET https://docs.degirum.com/pysdk/quickstart.md?ask= ``` -------------------------------- ### Install Token via CLI Source: https://docs.degirum.com/pysdk/token-installation-and-management Use this command to install a workspace token on a device. Installing a new token will replace any existing one. ```bash degirum token install ``` -------------------------------- ### Install HailoRT PCIe Driver Source: https://docs.degirum.com/pysdk/runtimes-and-drivers/hailort Install the HailoRT PCIe driver by running this command after downloading the driver package. A system restart is required after installation. ```bash sudo dpkg --install hailort-pcie-driver_4.23.0_all.deb ``` -------------------------------- ### Install Akida PCIe Driver Source: https://docs.degirum.com/pysdk/runtimes-and-drivers/akida Installs the Akida PCIe driver by cloning the repository and running the provided installation script. This is necessary if no Brainchip device is detected. ```bash git clone https://github.com/Brainchip-Inc/akida_dw_edma cd akida_dw_edma sudo ./install.sh ``` -------------------------------- ### Install AI Hub Token using Degirum CLI Source: https://docs.degirum.com/pysdk/installation Install your AI Hub token using the `degirum` CLI. Replace `` with your actual AI Hub token string. ```bash degirum token install ``` -------------------------------- ### Verify HailoRT Installation Source: https://docs.degirum.com/pysdk/runtimes-and-drivers/hailort After installing HailoRT and its driver, and restarting your PC, use this command to verify that the installation was successful and the hardware is recognized. ```bash hailortcli fw-control identify ``` -------------------------------- ### Install RKNN Runtime Source: https://docs.degirum.com/pysdk/runtimes-and-drivers/rknn Install the RKNN runtime by cloning the official repository and copying the shared library to the system's library directory. Ensure you have sudo privileges for the copy operation. ```bash git clone https://github.com/airockchip/rknn-toolkit2.git cd rknn-toolkit2 sudo cp ./rknpu2/runtime/Linux/librknn_api/aarch64/librknnrt.so /usr/lib/ ``` -------------------------------- ### Start AI Server with Custom Zoo Source: https://docs.degirum.com/pysdk/user-guide-pysdk/command-line-interface Starts the AI server, serving models from a specified local directory. By default, it uses the 'asio' protocol and the current directory as the model zoo. ```bash degirum server start --zoo ./my-zoo ``` -------------------------------- ### Install Device-Specific Token during Provisioning Source: https://docs.degirum.com/pysdk/token-installation-and-management This command is used during the provisioning process to install a unique token for each device, recommended for IT-managed fleets. ```bash degirum token install ``` -------------------------------- ### Install Workspace Token Source: https://docs.degirum.com/pysdk/token-installation-and-management Install the correct Workspace token if one is missing or if you need to switch to a different Workspace. Replace `` with your actual token string. ```bash degirum token install --token ``` -------------------------------- ### Install HailoRT Package Source: https://docs.degirum.com/pysdk/runtimes-and-drivers/hailort After downloading the appropriate HailoRT .deb package for your system's architecture, use this command to install it. Replace `` with your system's architecture (e.g., amd64, arm64). ```bash sudo dpkg --install hailort_4.23.0_.deb ``` -------------------------------- ### Example Inference Output Source: https://docs.degirum.com/pysdk/quickstart This is an example of the output format you can expect after performing inference with the DeGirum PySDK. ```text - bbox: [241.37208024326583, 113.8805459421775, 897.3911454167619, 704.7711576639625] category_id: 15 label: cat score: 0.8781571984291077 ``` -------------------------------- ### Install Latest Runtime Source: https://docs.degirum.com/pysdk/user-guide-pysdk/command-line-interface Installs the latest available version of a specified AI accelerator runtime library. Ensure the runtime name is valid. ```bash degirum install-runtime onnx ``` -------------------------------- ### Verify PySDK Installation (Linux) Source: https://docs.degirum.com/pysdk/installation Checks the PySDK installation by running the 'degirum sys-info' command. A list of detected devices indicates a successful installation. ```bash degirum sys-info ``` -------------------------------- ### Start AI Server with Both Protocols and Custom Ports Source: https://docs.degirum.com/pysdk/user-guide-pysdk/command-line-interface Starts the AI server with both 'asio' and 'http' protocols enabled, binding to specified ports. The first port is for 'asio', and the second is for 'http'. ```bash degirum server start --zoo ./my-zoo --port 12345 --protocol both ``` -------------------------------- ### Install PySDK with pip on Windows Source: https://docs.degirum.com/pysdk/installation Install PySDK and optionally degirum-tools using pip, specifying the custom package index. ```powershell pip install -i https://pkg.degirum.com degirum ``` ```powershell pip install -i https://pkg.degirum.com degirum degirum-tools ``` -------------------------------- ### Install Akida Runtime Source: https://docs.degirum.com/pysdk/runtimes-and-drivers/akida Installs the specified version of the Akida Runtime package. Ensure your pip is up to date before running. ```bash pip install --upgrade pip pip install akida==2.11.0 ``` -------------------------------- ### List Available Runtimes Source: https://docs.degirum.com/pysdk/user-guide-pysdk/command-line-interface Use this command to list all available AI accelerator runtime libraries and their versions that can be installed. ```bash degirum install-runtime --list ``` -------------------------------- ### Install Specific Runtime Version Source: https://docs.degirum.com/pysdk/user-guide-pysdk/command-line-interface Installs a specific version of an AI accelerator runtime library. You can also install multiple versions by providing them as a comma-separated list. ```bash degirum install-runtime openvino 2025.3.0 ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.degirum.com/pysdk/runtimes-and-drivers/tensorrt To get additional information not explicitly present on the page, perform an HTTP GET request with an 'ask' query parameter. The question should be specific and self-contained. ```http GET https://docs.degirum.com/pysdk/runtimes-and-drivers/tensorrt.md?ask= ``` -------------------------------- ### Minimum Code Example for Loading a Model Source: https://docs.degirum.com/pysdk/user-guide-pysdk/loading-an-ai-model This streamlined example shows the essential parameters required to load a model directly using degirum.load_model(). It includes the model name, inference host address, zoo URL, and token, with a comment indicating where optional parameters can be added. ```python import degirum as dg # Loading a model model = dg.load_model( model_name = "yolov8n_relu6_coco--640x640_quant_rknn_rk3588_1", inference_host_address = "@cloud", zoo_url = "degirum/public", token = your_token # optional parameters, such as overlay_show_probabilities = True ) print(model) ``` -------------------------------- ### Install DeGirum PySDK using Pip Source: https://docs.degirum.com/pysdk/installation Use this command to install the DeGirum PySDK from DeGirum's package index. It is recommended to do this within a virtual environment. ```bash pip install -i https://pkg.degirum.com degirum ``` -------------------------------- ### Verify Akida Installation Source: https://docs.degirum.com/pysdk/runtimes-and-drivers/akida Checks if the Akida Runtime is installed correctly by querying its version. ```bash akida version ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.degirum.com/pysdk/user-guide-pysdk/archive To get information not directly on the page, make an HTTP GET request to the current page URL with an 'ask' query parameter. The question should be specific and in natural language. The response includes the answer and relevant documentation excerpts. ```http GET https://docs.degirum.com/pysdk/user-guide-pysdk/archive.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.degirum.com/pysdk/eula Perform an HTTP GET request on the current page URL with the `ask` query parameter to dynamically query the documentation. The question should be specific and self-contained. Use this when the answer is not explicitly present, for clarification, or to retrieve related documentation. ```HTTP GET https://docs.degirum.com/pysdk/eula.md?ask= ``` -------------------------------- ### Query Documentation via GET Request Source: https://docs.degirum.com/pysdk/user-guide-pysdk/api-ref/misc To get additional information not directly present on the page, perform an HTTP GET request to the current page URL with the 'ask' query parameter. The question should be specific and self-contained. ```http GET https://docs.degirum.com/pysdk/user-guide-pysdk/api-ref/misc.md?ask= ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.degirum.com/pysdk/token-installation-and-management Perform an HTTP GET request to the documentation URL with the `ask` query parameter to dynamically query for information not explicitly present on the page. The question should be specific and self-contained. ```http GET https://docs.degirum.com/pysdk/token-installation-and-management.md?ask= ``` -------------------------------- ### Install Axelera Runtime and Driver Packages Source: https://docs.degirum.com/pysdk/runtimes-and-drivers/axelera Installs the specified versions of the Axelera runtime, device driver, Metis DKMS, and RISC-V toolchain. ```bash sudo apt install -y axelera-runtime-1.4.0 axelera-device-1.4.0 metis-dkms=1.2.2 axelera-riscv-gnu-newlib-toolchain-409b951ba662-7 ``` -------------------------------- ### Example Output for Model Input Data Type Source: https://docs.degirum.com/pysdk/user-guide-pysdk/running-ai-model-inference Shows an example output when querying a model's input types, indicating that the model expects image data. ```text ['Image'] ``` -------------------------------- ### Query Axelera Documentation Source: https://docs.degirum.com/pysdk/runtimes-and-drivers/axelera Demonstrates how to query the documentation dynamically using an HTTP GET request with an 'ask' query parameter. ```http GET https://docs.degirum.com/pysdk/runtimes-and-drivers/axelera.md?ask= ``` -------------------------------- ### Querying Documentation Dynamically Source: https://docs.degirum.com/pysdk/user-guide-pysdk To get information not explicitly on the page, perform an HTTP GET request to the current page URL with the `ask` query parameter. The question should be specific and self-contained. The response includes the answer and relevant excerpts. ```http GET https://docs.degirum.com/pysdk/user-guide-pysdk.md?ask= ``` -------------------------------- ### Start degirum Linux Service Source: https://docs.degirum.com/pysdk/user-guide-pysdk/setting-up-an-ai-server Start the degirum AI server as a Linux system service using systemctl. This command requires sudo privileges. ```bash sudo systemctl start degirum.service ``` -------------------------------- ### Query Documentation via HTTP GET Source: https://docs.degirum.com/pysdk/user-guide-pysdk/setting-up-an-ai-server Perform an HTTP GET request to the current page URL with the `ask` query parameter to dynamically query documentation. The question should be specific and in natural language. ```http GET https://docs.degirum.com/pysdk/user-guide-pysdk/setting-up-an-ai-server.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.degirum.com/pysdk/installation To get additional information not directly on the page, perform an HTTP GET request with the 'ask' query parameter. The question should be specific and in natural language. ```http GET https://docs.degirum.com/pysdk/installation.md?ask= ``` -------------------------------- ### Perform HTTP GET Request with `ask` Parameter Source: https://docs.degirum.com/pysdk/release-notes/retired-versions Use this method to query documentation dynamically when information is not directly available. The question should be specific and self-contained. ```http GET https://docs.degirum.com/pysdk/release-notes/retired-versions.md?ask= ``` -------------------------------- ### Install an AI Hub Token Source: https://docs.degirum.com/pysdk/user-guide-pysdk/command-line-interface Use this command to save a provided token to local storage. The token will then be automatically used by PySDK. ```bash degirum token install --token ``` -------------------------------- ### Ask a Question via GET Request Source: https://docs.degirum.com/pysdk Use this method to perform an HTTP GET request on the documentation index with the 'ask' parameter to find specific information. The question should be specific, self-contained, and written in natural language. ```http GET https://docs.degirum.com/readme.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.degirum.com/pysdk/runtimes-and-drivers To get additional information not directly present on the page, perform an HTTP GET request with the 'ask' query parameter. The question should be specific and in natural language. Use this for clarifications or to retrieve related documentation. ```http GET https://docs.degirum.com/pysdk/runtimes-and-drivers.md?ask= ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.degirum.com/pysdk/user-guide-pysdk/running-ai-model-inference To get additional information not present on the page, perform an HTTP GET request to the current page URL with the `ask` query parameter. The question should be specific and in natural language. ```http GET https://docs.degirum.com/pysdk/user-guide-pysdk/running-ai-model-inference.md?ask= ``` -------------------------------- ### Landmark Object Detection Results Example Source: https://docs.degirum.com/pysdk/user-guide-pysdk/api-ref/postprocessor Illustrates the structure for landmark detection results, which may include keypoint coordinates and connectivity information. ```python [ { 'landmarks': [ ``` -------------------------------- ### Get Supported Devices Source: https://docs.degirum.com/pysdk/release-notes/retired-versions Obtain a list of supported runtime/device combinations for a specified inference engine. This helps in identifying compatible hardware and software configurations. ```python supported_device_types = degirum.get_supported_devices("localhost") ``` -------------------------------- ### Example Output of Loaded Model Source: https://docs.degirum.com/pysdk/user-guide-pysdk/loading-an-ai-model This shows the typical output when a model is successfully loaded, indicating the object type and its memory address. ```text ``` -------------------------------- ### Configure OpenVINO Environment on Linux Source: https://docs.degirum.com/pysdk/runtimes-and-drivers/openvino Run this command in a new terminal after installing OpenVINO via a .tgz archive to configure the environment. Ensure your interpreter is started from a terminal where this command has been executed. ```bash source /setupvars.sh ``` -------------------------------- ### Batch Inference on Video File with OpenCV Source: https://docs.degirum.com/pysdk/user-guide-pysdk/running-ai-model-inference Processes frames from a video file using batch inference and displays the results overlaid on the video frames using OpenCV. This example requires `degirum` and `cv2` to be installed. ```python import degirum as dg import cv2 # Declaring variables ``` -------------------------------- ### Upgrade Pip for PySDK Installation Source: https://docs.degirum.com/pysdk/installation To resolve potential installation issues, upgrade your pip package installer to the latest version using this command. ```bash python3 -m pip install -U pip ``` -------------------------------- ### __enter__ Source: https://docs.degirum.com/pysdk/user-guide-pysdk/api-ref/model The context manager's entry point handler. ```APIDOC ## __enter__ `degirum.model.Model.__enter__()` Context manager enter handler. ``` -------------------------------- ### Loading an AI Model with degirum.load_model() Source: https://docs.degirum.com/pysdk/user-guide-pysdk/loading-an-ai-model This example demonstrates loading an AI model using degirum.load_model(). It first retrieves supported devices and lists available models, then loads the first model from the list with specific optional parameters like overlay_show_probabilities and output_confidence_threshold. ```python import degirum as dg # Set your inference host address, model zoo, and token in these variables. your_host_address = "@cloud" # Can be "@cloud", host:port, or "@local" your_model_zoo = "degirum/public" your_token = "" # Retrieve supported device types supported_devices = dg.get_supported_devices( inference_host_address = your_host_address, zoo_url = your_model_zoo, token = your_token, ) # List models from the AI Hub model zoo with specific filtering criteria model_list = dg.list_models( inference_host_address = your_host_address, zoo_url = your_model_zoo, token = your_token, device_type=list(supported_devices) ) # Load the first model from the list with some optional parameters model = dg.load_model( model_name = list(model_list)[0], inference_host_address = your_host_address, zoo_url = your_model_zoo, token = your_token, overlay_show_probabilities = True, output_confidence_threshold = 0.5 ) print(model) ``` -------------------------------- ### Configure degirum.service for Linux Source: https://docs.degirum.com/pysdk/user-guide-pysdk/setting-up-an-ai-server Create a systemd service configuration file to automatically start the AI server on boot. Ensure you replace placeholders like and with your specific details. ```ini [Unit] Description=DeGirum AI Service [Service] WorkingDirectory=/home// ExecStart= -m degirum.server --zoo /home//zoo Restart=always RestartSec=10 SyslogIdentifier=degirum-ai-server User= [Install] WantedBy=multi-user.target ``` -------------------------------- ### Verify PySDK Installation on Windows Source: https://docs.degirum.com/pysdk/installation Run this command in your active virtual environment to check if PySDK is installed correctly. A list of detected devices indicates a successful installation. ```powershell degirum sys-info ``` ```powershell (degirum-windows) PS C:\degirum\degirum-windows\Scripts> degirum sys-info Devices: N2X/CPU: - '@Index': 0 TFLITE/CPU: - '@Index': 0 - '@Index': 1 - '@Index': 2 - '@Index': 3 Software Version: 1.0.0 ``` -------------------------------- ### Enable degirum Linux Service on Startup Source: https://docs.degirum.com/pysdk/user-guide-pysdk/setting-up-an-ai-server Configure the degirum AI server service to start automatically when the system boots up using systemctl. This command requires sudo privileges. ```bash sudo systemctl enable degirum.service ``` -------------------------------- ### Verify CUDA Installation Source: https://docs.degirum.com/pysdk/runtimes-and-drivers/tensorrt Check if the CUDA installation was successful by running the nvcc command to display the compiler version. ```bash nvcc --version ``` -------------------------------- ### Clear Installed Token via CLI Source: https://docs.degirum.com/pysdk/token-installation-and-management Removes the currently installed token from the device. This is useful for local cleanup when a device is reachable. ```bash degirum token clear ``` -------------------------------- ### Query Documentation with 'ask' Parameter Source: https://docs.degirum.com/pysdk/runtimes-and-drivers/memryxrt Perform an HTTP GET request to query the documentation dynamically. Use this when the answer is not explicitly present, you need clarification, or want to retrieve related documentation sections. ```http GET https://docs.degirum.com/pysdk/runtimes-and-drivers/memryxrt.md?ask= ``` -------------------------------- ### Model Zoo Directory Structure Example Source: https://docs.degirum.com/pysdk/user-guide-pysdk/organizing-models Organize each model in its own subdirectory containing all necessary files. This structure is followed by AI Hub and can be adopted for local model zoos. ```bash / ├── mobilenet_v2_imagenet--224x224_quant_n2x_orca1_1/ │ ├── mobilenet_v2_imagenet--224x224_quant_n2x_orca1_1.json │ ├── mobilenet_v2_imagenet--224x224_quant_n2x_orca1_1.n2x │ └── labels.json (if required) ├── yolov8n_coco--640x640_quant_openvino_1/ │ ├── yolov8n_coco--640x640_quant_openvino_1.json │ ├── yolov8n_coco--640x640_quant_openvino_1.xml │ ├── yolov8n_coco--640x640_quant_openvino_1.bin │ └── postprocess.py (if required) └── yolov8n_relu6_coco_pose--640x640_quant_tflite_edgetpu_1/ ├── yolov8n_relu6_coco_pose--640x640_quant_tflite_edgetpu_1.json ├── yolov8n_relu6_coco_pose--640x640_quant_tflite_edgetpu_1.tflite └── labels.json (if required) ``` -------------------------------- ### Update PATH and LD_LIBRARY_PATH for CUDA Source: https://docs.degirum.com/pysdk/runtimes-and-drivers/tensorrt After installing CUDA on Linux, update your PATH and LD_LIBRARY_PATH environment variables. Replace with your installed CUDA version. ```bash export PATH=/usr/local/cuda-/bin${PATH:+:${PATH}} export LD_LIBRARY_PATH=/usr/local/cuda-/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} ``` -------------------------------- ### Install Python on Raspberry Pi OS Source: https://docs.degirum.com/pysdk/installation Updates package lists and upgrades installed packages on Raspberry Pi OS. Python 3 is pre-installed on 64-bit versions. ```bash sudo apt update sudo apt upgrade -y ``` -------------------------------- ### Install Python on Ubuntu 24.04 Source: https://docs.degirum.com/pysdk/installation Installs Python 3 and the venv module on Ubuntu 24.04. Ensure package lists are updated and existing packages are upgraded first. ```bash sudo apt update sudo apt upgrade -y sudo apt install -y python3 python3-venv ``` -------------------------------- ### Check RKNN Runtime Installation Source: https://docs.degirum.com/pysdk/runtimes-and-drivers/rknn Verify if the RKNN runtime library is installed by checking its version string. This command helps confirm the presence and version of the librknnrt.so file. ```bash strings /usr/lib/librknnrt.so | grep librknnrt ``` ```bash librknnrt version: 2.0.0b0 (35a6907d79@2024-03-24T10:31:14) ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.degirum.com/pysdk/runtimes-and-drivers/openvino Perform an HTTP GET request on the documentation URL with the 'ask' query parameter to retrieve specific information not explicitly present on the page. The question should be specific and self-contained. ```http GET https://docs.degirum.com/pysdk/runtimes-and-drivers/openvino.md?ask= ``` -------------------------------- ### Sample JSON Configuration Source: https://docs.degirum.com/pysdk/user-guide-pysdk/model-json-structure Include or omit parameters as your model requires. This is a template for model configuration. ```json { "ConfigVersion": , "Checksum": "", "DEVICE": [ { "DeviceType": "", "RuntimeAgent": "", "SupportedDeviceTypes": "" } ], "PRE_PROCESS": [ { "InputN": , "InputH": , "InputW": , "InputC": , "InputQuantEn": } ], "MODEL_PARAMETERS": [ { "ModelPath": "" } ], "POST_PROCESS": [ { "OutputPostprocessType": "", "OutputNumClasses": , "LabelsPath": "" } ] } ``` -------------------------------- ### Start DeGirum AI Server Source: https://docs.degirum.com/pysdk/user-guide-pysdk/api-ref/server Launches the DeGirum AI server. Specify the path to your local model zoo directory using `--zoo`. Optionally, you can set a custom TCP port with `--port`; otherwise, it defaults to 8778. ```bash python -m degirum.server --zoo [--port ] ``` -------------------------------- ### Query Documentation Dynamically Source: https://docs.degirum.com/pysdk/user-guide-pysdk/api-ref Perform an HTTP GET request on the current page URL with the `ask` query parameter to dynamically query the documentation. The question should be specific, self-contained, and written in natural language. Use this mechanism when the answer is not explicitly present, you need clarification, or want to retrieve related documentation sections. ```http GET https://docs.degirum.com/pysdk/user-guide-pysdk/api-ref.md?ask= ```