otx.algorithms.anomaly.adapters.anomalib.callbacks#
Callbacks for OTX inference.
Classes
|
Callback that updates the OTX dataset during inference. |
|
Timer for logging iteration time for train, val, and test phases. |
|
Progress Callback. |
- class otx.algorithms.anomaly.adapters.anomalib.callbacks.AnomalyInferenceCallback(otx_dataset: DatasetEntity, labels: List[LabelEntity], task_type: TaskType)[source]#
Bases:
Callback
Callback that updates the OTX dataset during inference.
- class otx.algorithms.anomaly.adapters.anomalib.callbacks.IterationTimer(prog_bar: bool = True, on_step: bool = True, on_epoch: bool = True)[source]#
Bases:
Callback
Timer for logging iteration time for train, val, and test phases.
- on_test_batch_end(trainer: Trainer, pl_module: LightningModule, outputs: Tensor | Dict[str, Any], batch: Any, batch_idx: int, dataloader_idx: int = 0) None [source]#
Log iteration time on the test batch end.
- on_test_batch_start(trainer: Trainer, pl_module: LightningModule, batch: Any, batch_idx: int, dataloader_idx: int = 0) None [source]#
Log iteration data time on the test batch start.
- on_test_epoch_start(trainer: Trainer, pl_module: LightningModule) None [source]#
Reset timer before every test epoch starts.
- on_train_batch_end(trainer: Trainer, pl_module: LightningModule, outputs: Tensor | Dict[str, Any], batch: Any, batch_idx: int) None [source]#
Log iteration time on the training batch end.
- on_train_batch_start(trainer: Trainer, pl_module: LightningModule, batch: Any, batch_idx: int) None [source]#
Log iteration data time on the training batch start.
- on_train_epoch_start(trainer: Trainer, pl_module: LightningModule) None [source]#
Reset timer before every train epoch starts.
- on_validation_batch_end(trainer: Trainer, pl_module: LightningModule, outputs: Tensor | Dict[str, Any], batch: Any, batch_idx: int, dataloader_idx: int = 0) None [source]#
Log iteration time on the validation batch end.
- class otx.algorithms.anomaly.adapters.anomalib.callbacks.ProgressCallback(parameters: TrainParameters | InferenceParameters | OptimizationParameters | None = None)[source]#
Bases:
TQDMProgressBar
Progress Callback.
Modify progress callback to show completion of the entire training step.
- on_predict_batch_end(trainer, pl_module, outputs, batch, batch_idx, dataloader_idx)[source]#
Adds prediction completion percentage to the progress bar.
- on_test_batch_end(trainer, pl_module, outputs, batch, batch_idx, dataloader_idx)[source]#
Adds testing completion percentage to the progress bar.