Detector Builder
The detector_builder module defines the plug-in infrastructure that all
detectors share. Every detector must inherit from BaseClass and
implement the required interface; DetectorFactory() discovers and
instantiates the correct subclass at runtime from a plain string name.
BaseClass
DetectorFactory
- ecosound.detection.detector_builder.DetectorFactory(detector_name, *args, **kwargs)[source]
Detector Factory.
Loads the detector class defined by detector_name. Each detector class must be added to the __init__.py file.
For example : from .detector1 import Detector1
where Detector1 is the name of the detector class to load from teh .py file detection1
- Parameters:
detector_name (str) – Name of the detector class.
*args (any) – Input arguments for the detector selected.
**kwargs (any) – Keyword arguments for the detector selected.
- Raises:
ValueError – If detector_name doesn’t correspond to any of the detectors available.
- Return type:
Detector object