openvinotoolkit / anomalib

An anomaly detection library comprising state-of-the-art algorithms and features such as experiment management, hyper-parameter optimization, and edge inference.
https://anomalib.readthedocs.io/en/latest/
Apache License 2.0
3.6k stars 645 forks source link

The predicted result graph cannot be saved[Task]: #1755

Open MMYY-yy opened 6 months ago

MMYY-yy commented 6 months ago

What is the motivation for this task?

CLI: anomalib train --model Padim --data anomalib.data.MVTec --visualization.save true

Describe the solution you'd like

wherein visualization: save: true But the prediction results were not saved

This is the post run config file: config: null seed_everything: 3713414210 trainer: accelerator: auto strategy: auto devices: 1 num_nodes: 1 precision: null logger: null callbacks: null fast_dev_run: false max_epochs: null min_epochs: null max_steps: -1 min_steps: null max_time: null limit_train_batches: null limit_val_batches: null limit_test_batches: null limit_predict_batches: null overfit_batches: 0.0 val_check_interval: null check_val_every_n_epoch: 1 num_sanity_val_steps: null log_every_n_steps: null enable_checkpointing: null enable_progress_bar: null enable_model_summary: null accumulate_grad_batches: 1 gradient_clip_val: null gradient_clip_algorithm: null deterministic: null benchmark: null inference_mode: true use_distributed_sampler: true profiler: null detect_anomaly: false barebones: false plugins: null sync_batchnorm: false reload_dataloaders_every_n_epochs: 0 default_root_dir: results\padim\mvtec\bottle normalization: normalization_method: MIN_MAX visualization: visualizers: null save: true log: false show: false task: SEGMENTATION metrics: image:

Additional context

b51b6acfeb53cd8308a1f1bf595df19

ashwinvaidya17 commented 6 months ago

I will update the docs but in essence you need to pass the visualizer classes in the yaml as well.

...
visualization:
  save: true
  visualizers:
    - class_path: anomalib.utils.visualization.ImageVisualizer
      init_args:
        task: SEGMENTATION
    - class_path: anomalib.utils.visualization.MetricsVisualizer
...
MMYY-yy commented 6 months ago

I will update the docs but in essence you need to pass the visualizer classes in the yaml as well.我将更新文档,但从本质上讲,您还需要在 yaml 中传递可视化工具类。

...
visualization:
  save: true
  visualizers:
    - class_path: anomalib.utils.visualization.ImageVisualizer
      init_args:
        task: SEGMENTATION
    - class_path: anomalib.utils.visualization.MetricsVisualizer
...

Based on your suggestion,I have set relevant parameters in padim.yaml,But the prediction results were not saved

This is the configured yaml: model: class_path: anomalib.models.Padim init_args: layers:

metrics: pixel: AUROC

visualization: save: true visualizers: