Skip to content

image_size Training on how to use 512 * 512 #2722

Closed

Description

@monkeycc
# 1. Import required modules
from anomalib.data import MVTecAD
from anomalib.engine import Engine
from anomalib.models import EfficientAd

# 2. Create a dataset
# MVTecAD is a popular dataset for anomaly detection
datamodule = MVTecAD(
    root="./datasets/MVTecAD",  # Path to download/store the dataset
    category="bottle",  # MVTec category to use
    train_batch_size=32,  # Number of images per training batch
    eval_batch_size=32,  # Number of images per validation/test batch
    num_workers=8,  # Number of parallel processes for data loading
)

# 3. Initialize the model
# EfficientAd is a good default choice for beginners
model = EfficientAd()

# 4. Create the training engine
engine = Engine(max_epochs=10)  # Train for 10 epochs

# 5. Train the model
engine.fit(datamodule=datamodule, model=model)

image_size
Training on how to use 512 * 512 ?

Activity

  1. abc-125 commented on May 24, 2025

    @abc-125
    Contributor

    Hello,

    I think this should work in step 3:

    image_size = (512, 512)
    pre_processor = EfficientAd.configure_pre_processor(image_size=image_size)
    model = EfficientAd(pre_processor=pre_processor)
  2. locked and limited conversation to collaborators on May 24, 2025
  3. converted this issue into a discussion #2723 on May 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions