mirror of
https://github.com/hanzoai/anomalib.git
synced 2026-10-30 18:48:11 +00:00
The previous commit was meant to remove .github/workflows and removed every tracked path instead — 892 files, the whole repo. This puts back the 874 that were never in scope; the eighteen workflow files stay gone, for the reasons that commit gives. Content is byte-identical to 9d2aec9 outside .github/workflows.
1.2 KiB
1.2 KiB
Inference
These files provide an example on how to use the trained (and optionally optimized) models.
Currently, you can use the use the torch, OpenVINO, and lightning models.
Lightning Inference
The lightning_inference.py provides an example on how to use the trained ckpt file to run inference on a dataset.
Example:
python tools/inference/lightning_inference.py \
--model anomalib.models.Padim \
--ckpt_path results/padim/mvtecad/bottle/weights/lightning/model.ckpt \
--data.path datasets/MVTecAD/bottle/test/broken_large \
--output ./outputs
You can also use a config file with the entrypoint
Here is a simple YAML file for Padim Model.
ckpt_path: results/padim/mvtecad/bottle/weights/lightning/model.ckpt
data:
path: datasets/MVTecAD/bottle/test/broken_large
transform: null
image_size:
- 256
- 256
output: ./outputs
visualization_mode: simple
show: false
model:
class_path: anomalib.models.Padim
init_args:
layers:
- layer1
- layer2
- layer3
input_size:
- 256
- 256
backbone: resnet18
pre_trained: true
n_features: null
You can then use
python tools/inference/lightning_inference.py -c config.yaml