anomalib
anomalib copied to clipboard
🔨 Refactor Engine's predict method
What is the motivation for this task?
The predict method has the following signature
def predict(
self,
model: AnomalyModule | None = None,
dataloaders: EVAL_DATALOADERS | AnomalibDataModule | None = None,
datamodule: AnomalibDataModule | Dataset | PredictDataset | None = None,
return_predictions: bool | None = None,
ckpt_path: str | None = None,
) -> _PREDICT_OUTPUT | None:
This is confusing as data loader and data module accept data module and dataset as parameters interchangeably.
Ideally dataset can be another parameter that contains only PredictDataset
as input.
Describe the solution you'd like
The solution will require changes to cli.py as well.
Additional context
No response