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

🚀 Add Real-IAD dataset #2545

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

samet-akcay
Copy link
Contributor

📝 Description

This PR integrates the Real-IAD (Real Industrial Anomaly Detection) dataset into Anomalib. Real-IAD is a large-scale industrial anomaly detection dataset containing 30 categories of industrial objects, with both normal and anomalous samples captured from 5 different camera viewpoints.

Key Features

  1. Dataset Support

    • 30 industrial object categories
    • Multiple image resolutions (256x256, 512x512, 1024x1024)
    • Multi-view support (5 camera angles)
    • Both classification and segmentation tasks
    • Flexible JSON metadata organization
  2. Core Components

    • RealIADDataset: PyTorch Dataset implementation
    • RealIAD: PyTorch Lightning DataModule
    • JSON-based metadata handling for flexible dataset organization
    • Support for different dataset versions (base, single-view, FUIAD)
  3. Integration Features

    • Automatic resolution handling (both string and integer inputs)
    • Comprehensive input validation
    • Flexible metadata file selection
    • Dynamic train/test split management
    • Automatic task type detection (classification/segmentation)

Implementation Details

Key Features

  • Resolution Support: Multiple predefined resolutions (256, 512, 1024)
  • Metadata Flexibility: Support for different metadata versions
    • Base metadata (multi-view)
    • Single-view metadata
    • FUIAD metadata versions
  • Data Organization: Clear directory structure for normal/abnormal samples
  • Validation: Comprehensive input validation and error handling

Usage Examples

# Basic usage
datamodule = RealIAD(
    root="./datasets/Real-IAD",
    category="audiojack",
    resolution=256
)

# Using different metadata version
datamodule = RealIAD(
    category="button_battery",
    resolution=1024,
    json_path="realiad_jsons/realiad_jsons_sv/{category}.json"
)

✨ Changes

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.

@samet-akcay samet-akcay changed the title Add Real-IAD dataset implementation 🚀 Add Real-IAD dataset implementation Feb 3, 2025
Signed-off-by: Samet Akcay <[email protected]>
Signed-off-by: Samet Akcay <[email protected]>
@samet-akcay samet-akcay marked this pull request as ready for review March 7, 2025 06:50
@samet-akcay samet-akcay requested a review from djdameln as a code owner March 7, 2025 06:50
Signed-off-by: Samet Akcay <[email protected]>
Signed-off-by: Samet Akcay <[email protected]>
@samet-akcay samet-akcay changed the title 🚀 Add Real-IAD dataset implementation 🚀 Add Real-IAD dataset Mar 7, 2025
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.

2 participants