3from ids_peak_common.pipeline.modules.imodule
import IModule
4from ids_peak_common.serialization
import IArchive
11 Base class for all pipeline modules.
13 @ingroup ids_peak_icv_python_pipeline_modules
14 @since ids_peak_icv 1.0
20 Creates an instance of class ModuleBase.
22 @since ids_peak_icv 1.0
31 Return the module version.
33 @return Module version.
35 @since ids_peak_icv 1.0
43 Gets whether this module is enabled.
45 When disabled, `process` returns the input image unchanged.
47 @return True if the module is enabled, False otherwise.
49 @since ids_peak_icv 1.0
57 Enables or disables the module.
59 When disabled, `process` returns the input image unchanged.
61 @param enabled: True to enable, False to disable.
63 @since ids_peak_icv 1.0
72 Serializes the object's internal state into the provided archive.
74 This function populates the given archive with all parameters required to fully represent the current state of the object.
75 It ensures that the object can be reconstructed or transmitted accurately by saving all relevant data members
76 in a consistent and structured format.
78 @param archive: The target archive that will store the serialized parameters.
80 @since ids_peak_icv 1.0
88 Restores the object's state from the provided archive.
90 This function reads and applies all necessary parameters from the given archive to reconstruct the internal state of the object.
91 It ensures that the object is restored to a valid and consistent state.
93 @param archive: The source archive containing the serialized parameters.
95 @exception CorruptedException: If Archive is malformed, misses keys or the values are invalid.
96 @exception NotSupportedException: If the 'Version' entry indicates an unsupported version.
98 @note This function requires that the archive contains all expected fields as produced by a corresponding serialize() call.
100 @since ids_peak_icv 1.0
106 archive_version = archive.get(
"Version", int)
113 raise CorruptedException(f
"The given archive is corrupted. The key '{missing_archive_key}' is missing.")
117 "The given version in the settings exceeds the module version. "
118 f
"Given settings version: {actual_version}, Module version: {self.version}. "
119 "The module version has to be >= the given settings version.")
Occurs when reading from a file or stream that is incomplete, damaged, or in an unexpected format.
Occurs when a requested operation is not implemented or supported (e.g., exporting to an unsupported ...
Base class for all pipeline modules.
int version(self)
Return the module version.
None deserialize(self, IArchive archive)
Restores the object's state from the provided archive.
None _validate_version(self, IArchive archive)
None __init__(self)
Creates an instance of class ModuleBase.
bool enabled(self)
Gets whether this module is enabled.
None _raise_corrupted_archive_key_missing(self, str missing_archive_key)
None _raise_version_is_not_supported(self, str actual_version, str expected_version)
None serialize(self, IArchive archive)
Serializes the object's internal state into the provided archive.
None enabled(self, bool enabled)
Enables or disables the module.