Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logger to write to CSV files. #2226

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
)
Loading