Describe the bug
With the pre-processor refactor, CLI does not allow setting the image size easily. If one really wants to modify it, they need to recreate the entire pre-processor
anomalib train --model Padim \
--data MVTecAD \
--data.category transistor \
--model.pre_processor anomalib.pre_processing.PreProcessor \
--model.pre_processor.transform torchvision.transforms.v2.Compose \
--model.pre_processor.transform.transforms '[torchvision.transforms.v2.Resize([512,512]),torchvision.transforms.v2.Normalize([0.485,0.456,0.406],[0.229,0.224,0.225])]'
Or more practically, use a YAML config file:
model:
class_path: anomalib.models.Padim
init_args:
backbone: resnet18
pre_processor:
class_path: anomalib.pre_processing.PreProcessor
init_args:
transform:
class_path: torchvision.transforms.v2.Compose
init_args:
transforms:
- class_path: torchvision.transforms.v2.Resize
init_args:
size: [512, 512]
antialias: true
- class_path: torchvision.transforms.v2.Normalize
init_args:
mean: [0.485, 0.456, 0.406]
std: [0.229, 0.224, 0.225]
data:
class_path: anomalib.data.MVTecAD
init_args:
category: transistor
Then run:
anomalib train --config config.yaml
Dataset
N/A
Model
N/A
Steps to reproduce the behavior
N/A
OS information
OS information:
Expected behavior
Should allow a simple way to update input size
Screenshots
No response
Pip/GitHub
GitHub
What version/branch did you use?
main
Configuration YAML
Logs
Code of Conduct
Describe the bug
With the pre-processor refactor, CLI does not allow setting the image size easily. If one really wants to modify it, they need to recreate the entire pre-processor
anomalib train --model Padim \ --data MVTecAD \ --data.category transistor \ --model.pre_processor anomalib.pre_processing.PreProcessor \ --model.pre_processor.transform torchvision.transforms.v2.Compose \ --model.pre_processor.transform.transforms '[torchvision.transforms.v2.Resize([512,512]),torchvision.transforms.v2.Normalize([0.485,0.456,0.406],[0.229,0.224,0.225])]'Or more practically, use a YAML config file:
Then run:
anomalib train --config config.yamlDataset
N/A
Model
N/A
Steps to reproduce the behavior
N/A
OS information
OS information:
Expected behavior
Should allow a simple way to update input size
Screenshots
No response
Pip/GitHub
GitHub
What version/branch did you use?
main
Configuration YAML
n/aLogs
Code of Conduct