anomalib icon indicating copy to clipboard operation
anomalib copied to clipboard

🔨 Refactor Engine's predict method

Open ashwinvaidya17 opened this issue 1 year ago • 0 comments

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

ashwinvaidya17 avatar Feb 21 '24 13:02 ashwinvaidya17