diff --git a/src/anomalib/loggers/__init__.py b/src/anomalib/loggers/__init__.py index 8c47306ddc..a170500aaa 100644 --- a/src/anomalib/loggers/__init__.py +++ b/src/anomalib/loggers/__init__.py @@ -17,6 +17,7 @@ from .mlflow import AnomalibMLFlowLogger # noqa: F401 from .tensorboard import AnomalibTensorBoardLogger # noqa: F401 from .wandb import AnomalibWandbLogger # noqa: F401 + from .csv_logger import AnomalibCSVLogger __all__.extend( [ @@ -24,6 +25,7 @@ "AnomalibTensorBoardLogger", "AnomalibWandbLogger", "AnomalibMLFlowLogger", + "AnomalibCSVLogger", ], ) except ImportError: diff --git a/src/anomalib/loggers/csv_logger.py b/src/anomalib/loggers/csv_logger.py new file mode 100644 index 0000000000..1bdb5107db --- /dev/null +++ b/src/anomalib/loggers/csv_logger.py @@ -0,0 +1,19 @@ +from lightning.pytorch.loggers import CSVLogger + + +class AnomalibCSVLogger(CSVLogger): + def __init__( + self, + save_dir: str, + name: str | None = "default", + version: int | str | None = None, + prefix: str = "", + flush_logs_every_n_step: int | None = 100, + ) -> None: + super().__init__( + save_dir=save_dir, + name=name, + version=version, + prefix=prefix, + flush_logs_every_n_steps=flush_logs_every_n_step, + )