Instantiate Datamodule, Model and Engine from config
What is the motivation for this task?
With 1.0.0dev version, I could use a config.yaml and get the prediction scores, customize the anomaly heatmap, etc. with the API. With the Pypi 1.0.1 version, the get_configurable_parameters function is abandoned, and I struggle to use an equivalent for parsing the config.yaml in a script using the API.
Describe the solution you'd like
I would like to have an equivalent of get_configurable_parameters function, usable in the API, in order to use the parameters included in this file, and the API capabilities.
Additional context
No response
Hi @CyrilWW, we will introduce a new method for Datamodule, Model and Engine, called from_config to be able to instantiate these objects with a config file.
# To instantiate a datamodule
datamodule = AnomalibDataModule.from_config("/path/to/your/data/config")
# To instantiate a model
model = AnomalyModel.from_config("/path/to/your/model/config")
# To instantiate Engine or all of these above
engine.from_config("/path/to/your/engine/or/full/config")
It's on our to-do list, but we haven't found time to implement this feature yet.
@harimkang kindly accepted to work on this!
https://github.com/openvinotoolkit/anomalib/pull/2065 - With the merge of this PR, the feature is complete as an Anomalib 1.1 target.