Savant Framework

repository·develop·Indexed 21 days ago

https://github.com/insight-platform/savant

A high-performance computer vision framework built on Nvidia DeepStream for creating real-time, scalable, and fault-tolerant multimedia AI pipelines. It supports both edge (Jetson) and data center (dGPU) environments, featuring declarative pipeline construction via YAML and Python, GPU-accelerated computing with OpenCV CUDA, PyTorch, and CuPy, and observability through OpenTelemetry and Prometheus.

Tokens
129.8K
Snippets
338
Records
517
Agent score
71%

What's inside Savant

  1. Overview of Savant Framework

    develop

    Savant is an open-source, high-level framework designed for building real-time, streaming, and highly efficient multimedia AI applications on the Nvidia stack. It provides an abstraction layer over Nvidia DeepStream, allowing developers to build dynamic, fault-tolerant inference pipelines for both data centers and edge devices without low-level programming.

    Key features include:

    • High performance on Nvidia hardware (dGPU and Jetson).
    • Declarative pipeline construction using YAML blocks and Python functions.
    • Support for heterogeneous pipelines with diverse models and data sources.
    • Observability via OpenTelemetry and Prometheus.
    • Support for hybrid edge/datacenter applications with a single codebase.
  2. Overview of Savant Features

    develop

    Savant is a high-performance computer vision framework designed for both NVIDIA edge devices (Jetson family) and data center hardware (Tesla, Quadro, etc.). It is built on top of DeepStream to provide real-time video analytics with low latency and high capacity.

    Key capabilities include:

    • Pipeline Support: Detection, classification, segmentation, tracking, and custom pre/post-processing.
    • Cloud-Ready: Runs in Docker containers with integrated OpenTelemetry and Prometheus support for monitoring and tracing.
    • High Performance: Supports GPU-accelerated computing via OpenCV CUDA, PyTorch, and CuPy, allowing data to stay in GPU RAM to avoid expensive CPU-GPU transfers.
    • Dynamic Management: Allows attaching/detaching sources and sinks dynamically and supports dynamic parameter ingestion via Etcd or per-frame metadata.
    • Development Tools: Includes a Development Server for dynamic code reloading and a Python-based Client SDK for interacting with pipelines.
  3. Overview of the Savant Framework

    develop

    Savant is an open-source, high-level framework written in Python, C++, and Rust designed for building real-time, streaming, and highly efficient computer vision AI applications. It is built on top of the Nvidia DeepStream SDK to provide a high-level abstraction that hides complexity while leveraging Nvidia's best technologies for both data center GPUs and Jetson edge devices.

    Key characteristics:

    • Target Hardware: Supports discrete Nvidia GPUs (Data Center) and Nvidia Jetson (Edge).
    • Pipeline Model: Pipelines are defined as a sequence of declarative blocks using YAML configuration, combined with user-defined logic implemented in Python.
    • Core Purpose: Enables rapid development of dynamic, fault-tolerant inference pipelines.
  4. Overview of the Savant Client SDK

    develop

    The Savant Client SDK is a Python library designed to simplify the development of sources and sinks using pure Python. It allows developers to ingest frames and metadata into a running Savant module and receive processed results.

    Key use cases include:

    • Developing integration tests for Pipelines (QA).
    • Implementing custom source adapters without needing deep knowledge of streaming technology.
    • Implementing custom sink adapters without needing deep knowledge of streaming technology.
    • Enabling remote development.
  5. Overview of the Facial ReID Sample

    develop

    The Facial ReID sample demonstrates a pipeline for facial re-identification using YOLOV8-Face (for detection and landmarks) and Adaface (for recognition). It is designed for use cases like doorbell security systems.

    The sample is divided into two functional modules:

    1. Index Builder: Processes a gallery of images to detect faces, perform preprocessing, and run recognition inference. It stores the resulting feature vectors in an hnswlib index and saves cropped face images to disk.
    2. Demo: Loads the generated index and cropped images, then processes a live video stream to detect and match faces, displaying matches in a side panel.

    Note: The first run takes a long time (30-40 minutes) because the models must be compiled into TensorRT engines.

  6. Overview of the Watchdog service

    develop
    The Watchdog service monitors the health of a Savant pipeline by watching one or more buffers in parallel. It detects issues such as slow processing or stalled pipelines by monitoring buffer queue lengths, ingress traffic, or egress traffic. When a threshold is exceeded (e.g., queue length too high or idle time too long), the service can automatically restart or stop designated pipeline services (containers) based on matching labels.
  7. Key features of the Savant framework

    develop

    Savant is a high-performance computer vision framework built on top of NVIDIA DeepStream. It is designed for both edge (Jetson) and data center (Tesla, Quadro) deployment using Docker containers.

    Key capabilities include:

    • Advanced Pipeline Support: Detection, classification, segmentation, tracking, and custom pre/post-processing.
    • High Performance: Real-time execution even for heavyweight segmentation models.
    • Flexible Processing Modes: Configurable for real-time (skipping data when at capacity) or high-capacity (guaranteeing processing of all data) modes.
    • Monitoring: Native support for OpenTelemetry (tracing) and Prometheus (metrics).
    • Dynamic Management: Ability to attach/detach sources and sinks and ingest dynamic parameters (via frame attributes, Etcd, or 3rd-party functions) without pipeline restarts.
    • GPU-Accelerated Python: Support for OpenCV CUDA, PyTorch, and CuPy, allowing developers to perform complex operations directly in GPU RAM to avoid CPU-GPU data transfer overhead.
  8. Overview of NvInfer inference units

    develop

    Savant uses DeepStream NvInfer to run inference via TensorRT-optimized neural networks. There are four primary types of inference units available, each serving a different purpose in a computer vision pipeline:

    • Detector Unit (nvinfer@detector): Used for models that produce bounding boxes, classes, and confidence scores (e.g., object detection).
    • Attribute Model Unit (nvinfer@attribute_model): Used for models that produce specific attributes from an input (e.g., gender, age, or facial landmarks). Note that Classifier Unit (nvinfer@classifier_model) is an alias for this unit.
    • Complex Model Unit (nvinfer@complex_model): Used for multi-task models that produce both bounding boxes/classes and attributes (e.g., keypoints) simultaneously.
  9. Understand Savant platform support indicators

    develop

    When reviewing Savant samples or documentation, platform support is indicated using the following labels:

    • X86 + L4T: Supported on both x86 and Jetson (L4T) platforms.
    • X86 only: Supported only on x86 platforms.
    • L4T only: Supported only on Jetson (L4T) platforms.

    If no platform is specified, the sample is assumed to be implemented for the X86 platform.

  10. What are Savant Adapters and how do they work?

    develop

    In Savant, a module is a Docker container running a computer vision pipeline. To interact with the external world (cameras, files, databases, etc.), modules use adapters.

    Adapters are standalone programs running in separate Docker containers. They decouple the module from data sources and destinations, providing fault tolerance: errors in an adapter do not propagate to the module.

    There are three main types of adapters:

    • Source adapters: Ingest data from external sources and provide it to modules.
    • Sink adapters: Consume data from modules and send it to external systems.
    • Bridge adapters: Consume data from other sources and ingest it.

    Adapters and modules communicate using the Savant Adapter Protocol, which is based on ZeroMQ and Savant-RS. The protocol supports transferring:

    • Video frames (optional)
    • Video stream-level information (encoding, fps, resolution, etc.)
    • Frame-related metadata (global per-frame attributes)
    • Hierarchical object data and attributes related to the frame.
  11. Understand Meta Merge ZMQ transport patterns

    develop

    All inter-service communication in the Meta Merge sample uses DEALER/ROUTER sockets over IPC. The connection pattern (whether a service binds or connects) is critical for the pipeline to function correctly.

    LinkWriter (DEALER)Reader (ROUTER)
    source → routerdealer+connectrouter+bind
    router → modulesdealer+bindrouter+connect
    modules → meta-mergedealer+connectrouter+bind
    meta-merge → visualizationdealer+bindrouter+connect
    visualization → sinkdealer+bindrouter+connect