Tasks

Tasks transform artefacts. Choose a task class in pipeline.yaml, give it a name, and connect its input and output artefact nodes. Commands use the configured name, not the class name:

collectra --pipeline pipeline.yaml task --help
collectra --pipeline pipeline.yaml task detect_lines --help
collectra --pipeline pipeline.yaml task detect_lines run --help

Command overview

Built-in task commands

Task class

Commands

ObjectDetectionYOLO

run, train

ObjectDetectionRFDETR

run, train

ObjectDetectionDETR

run, train

ImageSegmentationSam3

run, train

LineDetectorRLSA

run

LineDetectorSurya

run

ImageClassifierYOLO

run, train

ImageClassifierTorchvision

run, train

ImageClassifierHuggingFace

run, train

OCRSuraya

run

LLM

run

LLMCanonicaliser

run

IRNResolver

run

ImageOrienter

run

ConcatenateText

run

Running tasks

Every task supports run INPUTS... and run --help. Shared options are --output, --verbose, --usage, and --render. --usage records LLM token usage when supported, and --render requires Graphviz. Task-level run executes only the selected task. Its input artefacts must be present in the supplied results, or be the root image supplied as a raw file.

To execute a task and then its downstream tasks, use the pipeline command:

collectra --pipeline pipeline.yaml run results/page001.collectra --task detect_lines

Training tasks

Only the detection and classification tasks listed above expose train. Training consumes annotated Collectra result directories. Options differ by backend; use the particular task’s train --help. Torchvision and Hugging Face classifiers support opt-in experiment logging with --wandb. RF-DETR exposes --no-wandb to disable its default logging.

Training updates the task’s model in the pipeline and retains training logs by default. See Quickstart for preparing annotations and a complete training example. Evaluation and image extraction are artefact commands, not task commands.