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 synthetic anomaly datasets #2497

Merged
merged 6 commits into from
Jan 20, 2025
Merged

Conversation

alexriedel1
Copy link
Contributor

📝 Description

When using synthetic validation and test splits, the visualizer is broken.
This is because the path fort he synthetically generated anomalous samples is

ROOT = "./.tmp/synthetic_anomaly"

The visualizes generates output file names by looking up the dataset name in this path but cannot find it and terminates before saving the visualizer images.
dataset_index = next(i for i, part in enumerate(input_path.parts) if part.lower() == dataset_name.lower())

To overcome this the dataset name is added o the temporary dir.

Also this error was obscured by wrong exception handling:

try:
dataset_index = next(i for i, part in enumerate(input_path.parts) if part.lower() == dataset_name.lower())
except ValueError:
msg = f"Dataset name '{dataset_name}' not found in the input path."
raise ValueError(msg) from None

will not catch the error because it is a StopIteration type error and not an ValueError.

The right task type for synthetic dataset needs to be set manually and cannot be used from the folder dataset

✨ Changes

Select what type of change your PR is:

  • [X ] 🐞 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.

Copy link
Collaborator

@ashwinvaidya17 ashwinvaidya17 left a comment

Choose a reason for hiding this comment

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

Good catch

@samet-akcay samet-akcay enabled auto-merge January 20, 2025 14:48
@samet-akcay samet-akcay added this pull request to the merge queue Jan 20, 2025
@samet-akcay samet-akcay removed this pull request from the merge queue due to the queue being cleared Jan 20, 2025
@samet-akcay samet-akcay merged commit 1097cdf into openvinotoolkit:main Jan 20, 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.

3 participants