Configuration

This page describes how to configure the model that RAITAP will assess.

Options

Name

Allowed

Default

Description

source

string, null

null

Path to a local model file, or a built-in model name such as "resnet50". Refer to Using your own model or built-in models for more details.

arch

string, null

null

torchvision architecture name (e.g. "resnet18") used to instantiate the model when source points at a state-dict (a .pt / .pth file produced by torch.save(model.state_dict(), path)). Required alongside num_classes for state-dict loading; ignored for full pickled modules and TorchScript archives.

num_classes

int, null

null

Output classes used to instantiate the architecture before load_state_dict. Required together with arch for state-dict loading.

pretrained

bool

false

If true, construct the architecture with ImageNet pretrained weights before loading the state-dict (weights="DEFAULT"). Usually false since the state-dict already supplies the weights.

YAML example

# Option A: single model file.
# `source` is the only key. The format is inferred from the extension
# (.pt/.pth, .onnx, .ubj). Per-format details and caveats (state-dict vs
# TorchScript vs pickled, the unsafe-pickle consent, the `--extra xgboost`
# requirement for .ubj) are on the "Using your own model" page (linked
# from the `source` option above).
model:
  source: "path/to/model.<ext>"

# Option B: state-dict file.
# A state-dict carries no architecture, so add `arch` + `num_classes` to
# rebuild the model before loading the weights.
model:
  source: "weights.pth"
  arch: "resnet18"
  num_classes: 2

# Option C: built-in torchvision model — `source` is the model name, not a
# path. Loaded with torchvision's `weights="DEFAULT"` (latest pretrained
# weights, not configurable). For demos / quick testing; load your own
# weights via a file path (Options A/B).
model:
  source: "resnet50"

CLI override example

uv run raitap model.source=resnet50
raitap model.source=resnet50