Docs /Templates/ sinapsis-rfdetr

RFDETRLargeInference

sinapsis-rfdetrRFDetrimagemodelsrfdetrobject_detection

Python template · sinapsis_rfdetr.templates.rfdetr_inference

Overview

A class that handles the inference process for the RFDETRLarge model on a batch of images.

This class extends the `RFDETRInference` class and is responsible for processing a `DataContainer` holding image packets, running inference on each image, and updating the annotations with the model's predictions.

Capabilities

Capabilities: not set

Installation

Install the published package using pip or uv.

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

Configuration

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

metadata
sinapsis_core.template_base.base_models.TemplateMetadata | None
Optional
Default: null
threshold

A threshold for the confidence score used to filter the model's predictions. Default is 0.5.

float
Optional
Default: 0.5
model_params

An instance of `RFDETRLargeConfig` containing the model parameters for initializing the RF-DETR model. If not provided, default parameters from `RFDETRLargeConfig` will be used.

RFDETRLargeConfig
Optional
Default: null
amp
bool
Optional
Default: true
device
typing.Literal['cpu', 'cuda', 'mps']
Optional
Default: "cuda"
encoder
typing.Literal['dinov2_windowed_small', 'dinov2_windowed_base']
Optional
Default: "dinov2_windowed_base"
ca_nheads
int
Optional
Default: 24
sa_nheads
int
Optional
Default: 12
two_stage
bool
Optional
Default: true
dec_layers
int
Optional
Default: 3
group_detr
int
Optional
Default: 13
hidden_dim
int
Optional
Default: 384
layer_norm
bool
Optional
Default: true
num_select
int
Optional
Default: 300
patch_size
int
Optional
Default: 14
resolution
int
Optional
Default: 560
num_classes
int
Optional
Default: 90
num_queries
int
Optional
Default: 300
num_windows
int
Optional
Default: 4
bbox_reparam
bool
Optional
Default: true
dec_n_points
int
Optional
Default: 4
projector_scale
typing.List[typing.Literal['P3', 'P4', 'P5']]
Optional
Default: ["P3","P5"]
pretrain_weights
typing.Optional[str]
Optional
Default: "rf-detr-large.pth"
out_feature_indexes
typing.List[int]
Optional
Default: [2,5,8,11]
lite_refpoint_refine
bool
Optional
Default: true
gradient_checkpointing
bool
Optional
Default: false
positional_encoding_size
int
Optional
Default: 37
annotations_path

The file path to a JSON file containing annotations. If provided, this file will be used to map class IDs to labels.

str
Optional
Default: ""

Configuration example

Example from the Python docstring:

yaml
agent:
      name: my_test_agent
    templates:
    - template_name: InputTemplate
      class_name: InputTemplate
      attributes: {}
    - template_name: RFDETRLargeInference
      class_name: RFDETRLargeInference
      template_input: InputTemplate
      attributes:
        threshold: 0.5
        model_params:
            resolution: 560
            pretrain_weights: 'path/to/checkpoint'
Show schema-based configuration skeleton
yaml
templates:
  - template_name: "RFDETRLargeInference"
    class_name: "RFDETRLargeInference"
    attributes:
      threshold: 0.5
      model_params:
        amp: true
        device: "cuda"
        encoder: "dinov2_windowed_base"
        ca_nheads: 24
        sa_nheads: 12
        two_stage: true
        dec_layers: 3
        group_detr: 13
        hidden_dim: 384
        layer_norm: true
        num_select: 300
        patch_size: 14
        resolution: 560
        num_classes: 90
        num_queries: 300
        num_windows: 4
        bbox_reparam: true
        dec_n_points: 4
        projector_scale: ["P3", "P5"]
        pretrain_weights: "rf-detr-large.pth"
        out_feature_indexes: [2, 5, 8, 11]
        lite_refpoint_refine: true
        gradient_checkpointing: false
        positional_encoding_size: 37
      annotations_path: ""

Inheritance

Immediate parent: sinapsis_rfdetr.templates.rfdetr_inference.RFDETRInference

Environment variables

Environment definitions belong to their canonical Python modules.

No directly related environment variables listed.