LogoLogo
AI HubCommunityWebsite
  • Start Here
  • AI Hub
    • Overview
    • Quickstart
    • Teams
    • Device Farm
    • Browser Inference
    • Model Zoo
      • Hailo
      • Intel
      • MemryX
      • BrainChip
      • Google
      • DeGirum
      • Rockchip
    • View and Create Model Zoos
    • Model Compiler
    • PySDK Integration
  • PySDK
    • Overview
    • Quickstart
    • Installation
    • Runtimes and Drivers
      • Hailo
      • OpenVINO
      • MemryX
      • BrainChip
      • Rockchip
      • ONNX
    • PySDK User Guide
      • Core Concepts
      • Organizing Models
      • Setting Up an AI Server
      • Loading an AI Model
      • Running AI Model Inference
      • Model JSON Structure
      • Command Line Interface
      • API Reference Guide
        • PySDK Package
        • Model Module
        • Zoo Manager Module
        • Postprocessor Module
        • AI Server Module
        • Miscellaneous Modules
      • Older PySDK User Guides
        • PySDK 0.16.0
        • PySDK 0.15.2
        • PySDK 0.15.1
        • PySDK 0.15.0
        • PySDK 0.14.3
        • PySDK 0.14.2
        • PySDK 0.14.1
        • PySDK 0.14.0
        • PySDK 0.13.4
        • PySDK 0.13.3
        • PySDK 0.13.2
        • PySDK 0.13.1
        • PySDK 0.13.0
    • Release Notes
      • Retired Versions
    • EULA
  • DeGirum Tools
    • Overview
      • Streams
        • Streams Base
        • Streams Gizmos
      • Compound Models
      • Inference Support
      • Analyzers
        • Clip Saver
        • Event Detector
        • Line Count
        • Notifier
        • Object Selector
        • Object Tracker
        • Zone Count
  • DeGirumJS
    • Overview
    • Get Started
    • Understanding Results
    • Release Notes
    • API Reference Guides
      • DeGirumJS 0.1.3
      • DeGirumJS 0.1.2
      • DeGirumJS 0.1.1
      • DeGirumJS 0.1.0
      • DeGirumJS 0.0.9
      • DeGirumJS 0.0.8
      • DeGirumJS 0.0.7
      • DeGirumJS 0.0.6
      • DeGirumJS 0.0.5
      • DeGirumJS 0.0.4
      • DeGirumJS 0.0.3
      • DeGirumJS 0.0.2
      • DeGirumJS 0.0.1
  • Orca
    • Overview
    • Benchmarks
    • Unboxing and Installation
    • M.2 Setup
    • USB Setup
    • Thermal Management
    • Tools
  • Resources
    • External Links
Powered by GitBook

Get Started

  • AI Hub Quickstart
  • PySDK Quickstart
  • PySDK in Colab

Resources

  • AI Hub
  • Community
  • DeGirum Website

Social

  • LinkedIn
  • YouTube

Legal

  • PySDK EULA
  • Terms of Service
  • Privacy Policy

© 2025 DeGirum Corp.

On this page
  • Core Concepts
  • Streams
  • Compound Models
  • Analyzers
  • Inference Support Utilities

Was this helpful?

  1. DeGirum Tools

Overview

We provide the DeGirum Tools Python package to aid development of AI applications with PySDK. In this group, we'll outline main concepts of DeGirum Tools and provide the API Reference Guide.

PreviousEULANextStreams

Last updated 11 days ago

Was this helpful?

This overview was written for DeGirum Tools version 0.16.6.

Core Concepts

DeGirum Tools extends PySDK with a kit for building multi-threaded, low-latency media pipelines. Where PySDK focuses on running a single model well, DeGirum Tools focuses on everything around it: video ingest, pre-and post-processing, multi-model fusion, result annotation, stream routing, and more.

In one sentence:

DeGirum Tools is a flow-based mini-framework that lets you prototype complex AI applications in a few dozen lines of Python.

Streams

The flow behind DeGirum Tools is supported by the Streams subsystem. There are three constituent Python submodules: , , and . In this subsystem, the two most important concepts to understand in streams are gizmos and compositions.

Gizmos

A is a worker that:

1

Consumes from one or more input streams.

2

Runs its custom run() loop (decode, resize, infer, etc.).

3

Pushes new StreamData to any number of output streams. StreamData is described in more detail in .

Because every gizmo lives in its own thread, pipelines scale across CPU cores with almost no user code.

Gizmo families built into DeGirum Tools include:

Family
Example Classes
Typical Use

Video IO

Capture, live preview, archival

Transform

Pre-process frames (letterbox, crop, pad)

AI Inference

Run models, cascade detectors & classifiers

Post-fusion

Merge multi-crop or multi-model outputs

Utility

Collect results in the main thread

Compositions

  • start() – spawn threads

  • stop() – signal abort & join

  • wait() – block until completion

  • get_bottlenecks() – diagnose dropped-frame hotspots

Use it as a context-manager so everything shuts down even on exceptions.

Compound Models

Class
What it Does

Runs two models in parallel on the same image and concatenates results.

Detector → crops → classifier (adds labels back).

Detector → crops → refined detector (with optional NMS).

Use compound models exactly how you would use normal models:

compound = CroppingAndClassifyingCompoundModel(detector, classifier)
for res in compound.predict_batch(my_images):
    ...

Analyzers

Analyzers provide advanced processing of inference results with specialized functionality. The available analyzers include:

Analyzer
Description

Saves video clips of detected events

Detects and processes specific events in the video stream

Counts objects crossing defined lines in the scene

Sends notifications for detected events and conditions

Filters and selects specific objects based on criteria

Tracks objects across frames with customizable tracking parameters

Tracks objects entering and exiting defined zones

  • analyze(result) – Process and modify inference results by adding custom fields or performing calculations

  • annotate(result, image) – Draw overlays on the image (bounding boxes, text labels, etc.)

Analyzers can be attached to any model or compound model:

from degirum_tools.analyzers import LineCounter
import numpy as np

# Create a line counter that counts people crossing a horizontal line
# at y=300 pixels from the top of the frame
counter = LineCounter(
    line_start=(0, 300),      # start point of the line
    line_end=(640, 300),      # end point of the line
    class_filter="person",    # only count people
    direction="up"            # count only upward crossings
)

# Attach to your person detection model
model.attach_analyzers(counter)

# The counter will now track crossings and add them to results
# You can access the count with: result.analyzers["LineCounter"].count

When used inside a gizmo pipeline, analyzers can filter or decorate results in-flight. They can also accumulate state across frames for multi-frame analysis, with cleanup handled in the finalize() method.

Inference Support Utilities

, ,

,

,

Gizmos pass data around by using the class. A stream is an iterable queue that moves StreamData objects between threads. Each queue may be bounded (with optional drop policy) to prevent bottlenecks, and it automatically propagates a poison pill sentinel to shut the pipeline down cleanly.

A collects any connected gizmos and controls their life-cycle:

wrap two PySDK models into a singlepredict() / predict_batch() interface. Some compound models classes we provide in DeGirum Tools include:

An subclass provides two key capabilities:

The helpers smooth the edges between PySDK and your application. Inference Support utilities include:

– one-liner to pick AI Hub, AI Server, or local inference.

/ – quick video loops when a full gizmo graph is overkill.

– benchmark a model in <10 LOC.

streams.py
streams_base.py
streams_gizmos.py
Gizmo
streams.py
Stream
Compound models
Analyzer
inference_support
Clip Saver
Event Detector
Line Counter
Notifier
Object Selector
Object Tracker
Zone Counter
VideoSourceGizmo
VideoDisplayGizmo
VideoSaverGizmo
ResizingGizmo
AiSimpleGizmo
AiObjectDetectionCroppingGizmo
CropCombiningGizmo
AiResultCombiningGizmo
SinkGizmo
connect_model_zoo()
predict_stream()
annotate_video()
model_time_profile()
Composition
CombiningCompoundModel
CroppingAndClassifyingCompoundModel
CroppingAndDetectingCompoundModel