vis4d.engine.callbacks.evaluator
This module contains utilities for callbacks.
Classes
|
Callback for model evaluation. |
- class EvaluatorCallback(*args, evaluator, metrics_to_eval=None, save_predictions=False, save_prefix=None, output_dir=None, **kwargs)[source]
Callback for model evaluation.
- __init__(*args, evaluator, metrics_to_eval=None, save_predictions=False, save_prefix=None, output_dir=None, **kwargs)[source]
Init callback.
- Parameters:
evaluator (Evaluator) – Evaluator.
metrics_to_eval (list[str], Optional) – Metrics to evaluate. If None, all metrics in the evaluator will be evaluated. Defaults to None.
save_predictions (bool) – If the predictions should be saved. Defaults to False.
save_prefix (str, Optional) – Output directory for saving the evaluation results. Defaults to None.
output_dir (str, Optional) – Output directory for saving the evaluation results.
- on_validation_batch_end(trainer, pl_module, outputs, batch, batch_idx, dataloader_idx=0)[source]
Hook to run at the end of a validation batch.
- Return type:
None
- on_validation_epoch_end(trainer, pl_module)[source]
Wait for on_validation_epoch_end PL hook to call ‘evaluate’.
- Return type:
None
- on_test_batch_end(trainer, pl_module, outputs, batch, batch_idx, dataloader_idx=0)[source]
Hook to run at the end of a testing batch.
- Return type:
None
- on_test_epoch_end(trainer, pl_module)[source]
Hook to run at the end of a testing epoch.
- Return type:
None