Skip to main content
Version: 0.7.x [Latest Beta]

Denkflow Integration Guide

Beta Status

This software is currently in beta status. This means that:

  • Bugs may still be present
  • The API is stabilizing but breaking changes may still occur
Planned Features

The following features are planned for upcoming releases:

  • USB Dongle Support
  • C# API for .NET applications

Overview

Denkflow is DENKweit's solution for a complete end-to-end integration, from training AI models on our Vision AI Hub to executing them in your environment.

Currently, object detection and ocr are implemented for CPU, NVIDIA GPU and Jetson Orin devices.

Quick Start

from denkflow import Pipeline, ImageTensor

# Fill these with custom values
model_file = "path/to/model/file.denkflow"
pat = "personal_access_token";
image_file = "path/to/an/image.jpg"
confidence_threshold = 0.9

# Default Values for Object Detection
input_topic = "camera/image";
output_topic = "bounding_box_filter_node/filtered_bounding_boxes";

# --- Read Model File ---
pipeline = Pipeline.from_denkflow(model_file, pat=pat)

# --- Initialization ---
pipeline.initialize()

# --- Subscribe to Outputs ---
receiver = pipeline.subscribe(output_topic)

# --- Send Image into Pipeline ---
pipeline.publish_image_tensor(input_topic, ImageTensor.from_file(image_file))

# Alternative: For numpy arrays, use from_numpy_unsafe for significant speedups
# import numpy as np
# image_array = np.array(..., dtype=np.float32) # Your numpy array (B, 3, H, W) format, normalized by /255.0
# pipeline.publish_image_tensor(input_topic, ImageTensor.from_numpy_unsafe(image_array))
# WARNING: Ensure image_array lives as long as the ImageTensor to avoid undefined behavior

# --- Run Pipeline ---
pipeline.run()

# --- Receive and Process Results ---
objects = receiver.receive_bounding_box_tensor().to_objects(confidence_threshold)

print(f"\nDetected {len(objects)} objects:")
for obj in objects:
print(f"- Class: {obj.class_label.name}, Confidence: {obj.confidence:.2f}")
print(f" BBox: ({obj.x1}, {obj.y1}), ({obj.x2}, {obj.y2})")