anomalib icon indicating copy to clipboard operation
anomalib copied to clipboard

The predicted result graph cannot be saved[Task]:

Open MMYY-yy opened this issue 1 year ago • 2 comments

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:

  • F1Score
  • AUROC pixel: null threshold: class_path: anomalib.metrics.F1AdaptiveThreshold init_args: default_value: 0.5 pos_label: null task: null thresholds: null num_labels: null ignore_index: null validate_args: true compute_on_cpu: false dist_sync_on_step: false sync_on_compute: true logging: log_graph: false results_dir: path: results\padim\mvtec\bottle unique: false ckpt_path: null model: class_path: anomalib.models.Padim init_args: input_size:
    • 256
    • 256 backbone: resnet18 layers:
    • layer1
    • layer2
    • layer3 pre_trained: true n_features: null data: class_path: anomalib.data.MVTec init_args: root: datasets\MVTec category: bottle image_size:
    • 256
    • 256 center_crop: null normalization: IMAGENET train_batch_size: 32 eval_batch_size: 32 num_workers: 8 task: SEGMENTATION transform_config_train: null transform_config_eval: null test_split_mode: FROM_DIR test_split_ratio: 0.2 val_split_mode: SAME_AS_TEST val_split_ratio: 0.5 seed: null

Additional context

b51b6acfeb53cd8308a1f1bf595df19

MMYY-yy avatar Feb 20 '24 07:02 MMYY-yy

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
...

ashwinvaidya17 avatar Feb 21 '24 14:02 ashwinvaidya17

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: - layer1 - layer2 - layer3 input_size: null backbone: resnet18 pre_trained: true n_features: null

metrics: pixel: AUROC

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

MMYY-yy avatar Feb 22 '24 07:02 MMYY-yy