Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐞 Fix model-specific transforms for DRÆM and DSR #2624

Conversation

abc-125
Copy link
Contributor

@abc-125 abc-125 commented Mar 23, 2025

📝 Description

These models do not use Imagenet normalization. They had configure_transforms() to handle it, but it is never called, so default transforms with Imagenet normalization are applied. The training code is below, printing image values show that they are not between 0 and 1, as they should be.

from anomalib.data import MVTecAD
from anomalib.models import Draem
from anomalib.engine import Engine

# Initialize components
datamodule = MVTecAD()
model = Draem()
engine = Engine()

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

✨ Changes

This PR changes configure_transforms() in DRÆM and DSR to configure_pre_processor() to apply model-specific transforms properly.

Select what type of change your PR is:

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • 🔨 Refactor (non-breaking change which refactors the code base)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔒 Security update

✅ Checklist

Before you submit your pull request, please make sure you have completed the following steps:

  • 📋 I have summarized my changes in the CHANGELOG and followed the guidelines for my type of change (skip for minor changes, documentation updates, and test enhancements).
  • 📚 I have made the necessary updates to the documentation (if applicable).
  • 🧪 I have written tests that support my changes and prove that my fix is effective or my feature works (if applicable).

For more information about code review checklists, see the Code Review Checklist.

Sorry, something went wrong.

Verified

This commit was signed with the committer’s verified signature.
abc-125 Aimira Baitieva
@abc-125 abc-125 requested a review from samet-akcay as a code owner March 23, 2025 15:51

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy link
Contributor

@samet-akcay samet-akcay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reporting this and proposing a solution, @abc-125!

@samet-akcay samet-akcay merged commit 2c67065 into open-edge-platform:main Mar 24, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants