Docs /Templates/ sinapsis-rfdetr

RFDETRLargeExport

sinapsis-rfdetrRFDetrimagemodelsrfdetrobject_detection

Python template · sinapsis_rfdetr.templates.rfdetr_export

Overview

A class that handles the export process for the RFDETRLarge trained model to ONNX format.

This class is used to configure and execute the export of a trained RFDETRLarge model to the ONNX format.

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
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
export_params

A dictionary containing the export parameters for the RF-DETR model. If not specified, default parameters will be used.

ExportParams
Optional
Default: null
output_dir
str
Optional
Default: "/home/ariel/.cache/sinapsis/rfdetr/output"

Configuration example

Example from the Python docstring:

yaml
agent:
      name: my_test_agent
    templates:
    - template_name: InputTemplate
      class_name: InputTemplate
      attributes: {}
    - template_name: RFDETRLargeExport
      class_name: RFDETRLargeExport
      template_input: InputTemplate
      attributes:
        model_params:
            pretrain_weights: 'path/to/checkpoint'
        export_params:
            output_dir: 'path/to/save/export/model'
Show schema-based configuration skeleton
yaml
templates:
  - template_name: "RFDETRLargeExport"
    class_name: "RFDETRLargeExport"
    attributes:
      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
      export_params:
        output_dir: "/home/ariel/.cache/sinapsis/rfdetr/output"

Inheritance

Immediate parent: sinapsis_rfdetr.templates.rfdetr_export.RFDETRExport

Environment variables

Environment definitions belong to their canonical Python modules.

SINAPSIS_CACHE_DIR · defined elsewhere