nicetoolbox.detectors.base_detector.BaseDetector¶
- class nicetoolbox.detectors.base_detector.BaseDetector(io: SequenceIO, data: SequenceData, subsequence_context: SubsequenceContext, algorithm_instance: str)[source]¶
Bases:
ABCAbstract 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.
Methods
Compute extra output folders for all components.
Compute result folders for all components.
Compute visualization folders for all components.
Return the inputs to resolve for this detector.
Return the outputs this detector declares it will produce.
Execute the detector's main computation.
Visualize detector output.
Attributes
inputsoutputsAccess predictions mapping from runtime config.
algorithm_typealgorithm_instancedataiosubsequence_contextdetector_configinference_configcomponentsloaded_inputsdeclared_outputsvisualize- compute_output_folders(requires_out_folder: bool) Dict[str, str][source]¶
Compute extra output 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.
- resolve_inputs() List[BaseDetectorInput][source]¶
Return the inputs to resolve for this detector.
Defaults to the class-level inputs. Override to vary inputs by config (e.g. add an optional input only when a flag is set).
- resolve_outputs() List[BaseDetectorOutput][source]¶
Return the outputs this detector declares it will produce.
Defaults to the class-level outputs. Override to vary outputs by config (e.g. pick the npz_key/schema based on a per-instance dimension).