Skip to content

Commit

Permalink
feat: Add logger to write to csv files.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaitanyaYeole02 committed Jul 31, 2024
1 parent d1f824a commit e772bf9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/anomalib/loggers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
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(
[
"AnomalibCometLogger",
"AnomalibTensorBoardLogger",
"AnomalibWandbLogger",
"AnomalibMLFlowLogger",
"AnomalibCSVLogger",
],
)
except ImportError:
Expand Down
19 changes: 19 additions & 0 deletions src/anomalib/loggers/csv_logger.py
Original file line number Diff line number Diff line change
@@ -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,
)

0 comments on commit e772bf9

Please sign in to comment.