nicetoolbox.detectors.base_detector

Base class for all detectors (method and feature). Provides common interface and shared functionality.

Classes

BaseDetector

Abstract base class for ALL detectors.

class nicetoolbox.detectors.base_detector.BaseDetector(io: SequenceIO, data: SequenceData, sequence_context: SequenceRuntimeConfig, algorithm_instance: str)[source]

Abstract base class for ALL detectors.

Defines the common interface that both method and feature detectors implement. This enables a unified detector loop in main.py.

Initialize base detector with references.

Subclasses should call super().__init__() and set inference_config.

compute_output_folders(requires_out_folder: bool) Dict[str, str][source]

Compute extra output folders for all components.

compute_result_folders() Dict[str, str][source]

Compute result folders for all components.

compute_viz_folders(visualize: bool) Dict[str, str][source]

Compute visualization folders for all components.

property predictions_mapping

Access predictions mapping from runtime config.

abstract run() Any | None[source]

Execute the detector’s main computation.

For method detectors: runs subprocess inference + post_inference() For feature detectors: runs compute()

Returns:

Optional data for visualization (feature detectors currently return computed data)

abstract visualization(data: Any) None[source]

Visualize detector output.

Parameters:

data – Output from run() or external data source