You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 1. Import required modulesfromanomalib.dataimportMVTecADfromanomalib.engineimportEnginefromanomalib.modelsimportEfficientAd# 2. Create a dataset# MVTecAD is a popular dataset for anomaly detectiondatamodule=MVTecAD(
root="./datasets/MVTecAD", # Path to download/store the datasetcategory="bottle", # MVTec category to usetrain_batch_size=32, # Number of images per training batcheval_batch_size=32, # Number of images per validation/test batchnum_workers=8, # Number of parallel processes for data loading
)
# 3. Initialize the model# EfficientAd is a good default choice for beginnersmodel=EfficientAd()
# 4. Create the training engineengine=Engine(max_epochs=10) # Train for 10 epochs# 5. Train the modelengine.fit(datamodule=datamodule, model=model)
Activity
abc-125 commentedon May 24, 2025
Hello,
I think this should work in step 3: