Docs /Templates/ sinapsis-dfine

DFINEInference

sinapsis-dfineD-FINEdfineimageinferencemodels

Python template · sinapsis_dfine.templates.dfine_inference

Overview

Template designed to perform object detection inference on images using D-FINE.

This template handles the entire inference workflow: configuring the model and processor, processing the images from the container, running the model on them, postprocessing the model's outputs and saving the annotations.

Capabilities

Capabilities: not set

Installation

Install the published package using pip or uv.

Terminalbash
pip install sinapsis-dfine==1.0.0
uv pip install sinapsis-dfine==1.0.0
uv add sinapsis-dfine==1.0.0

Configuration

Effective fields from the inspector schema, including nested Pydantic model fields.

device
typing.Literal['auto', 'cuda', 'cpu']
Optional
Default: "auto"
metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
thresholdRequired
float
Required
Default: null
batch_size

The number of images to process in a single batch. If set to a non-positive value, all images will be processed in one batch. Defaults to 8.

int
Optional
Default: 8
model_path
str
Optional
Default: "ustc-community/dfine-nano-coco"
model_cache_dir
str
Optional
Default: "/home/ariel/.cache/sinapsis"

Configuration example

Example from the Python docstring:

yaml
agent:
      name: my_test_agent
    templates:
    - template_name: InputTemplate
      class_name: InputTemplate
      attributes: {}
    - template_name: DFINEInference
      class_name: DFINEInference
      template_input: InputTemplate
      attributes:
        model_path: ustc-community/dfine-small-coco
        batch_size: 16
        threshold: 0.5
        device: cuda
Show schema-based configuration skeleton
yaml
templates:
  - template_name: "DFINEInference"
    class_name: "DFINEInference"
    attributes:
      device: "auto"
      threshold: "<required>"
      batch_size: 8
      model_path: "ustc-community/dfine-nano-coco"
      model_cache_dir: "/home/ariel/.cache/sinapsis"

Inheritance

Immediate parent: sinapsis_dfine.templates.dfine_base.DFINEBase

Environment variables

Environment definitions belong to their canonical Python modules.

No directly related environment variables listed.