-
Notifications
You must be signed in to change notification settings - Fork 844
π feat(model): add GLASS model into Anomalib #2629
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
Open
code-dev05
wants to merge
29
commits into
open-edge-platform:feature/model/glass
Choose a base branch
from
code-dev05:feature/model/glass
base: feature/model/glass
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 18 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
5b4931b
Initial Implementation of GLASS Model
code-dev05 4789f49
Created the trainer class for glass model
code-dev05 050fd4c
Added suggested changes
code-dev05 cdd0984
Modified forward method for model
code-dev05 381eec6
Fixed backbone loading logic
code-dev05 9b1c51a
Added type for input shape
code-dev05 161005c
Fixed bugs
code-dev05 3d78beb
Merge branch 'main' into feature/model/glass
samet-akcay 617cf49
Changed files as needed
code-dev05 f9d3207
Merge remote-tracking branch 'origin/feature/model/glass' into featurβ¦
code-dev05 7fea20f
Matched code to the original implementation
code-dev05 1beedf5
Added support for gpu
code-dev05 838bc50
Refactored code from lightning model to torch model
code-dev05 1baa0b7
GPU bug fixed
code-dev05 f066b3c
used image device in torch model
code-dev05 6e780b0
fixed bug
code-dev05 b1be6f5
Added validation step
code-dev05 20d97dd
Merge branch 'main' into feature/model/glass
samet-akcay d5affe4
Refactored code for better readability
code-dev05 f008537
Merge remote-tracking branch 'origin/feature/model/glass' into featurβ¦
code-dev05 a1097e5
Set automatic optimization to False and made component functions
code-dev05 7e9d4d4
Resolved third-party-programs.txt conflict
code-dev05 44dcd60
Added automated download for dtd dataset in Glass Model
code-dev05 da57095
Removed some input args
code-dev05 ba5a6dd
Change in default parameters
code-dev05 714a3c3
Fixed default backbone name
code-dev05 1a3519c
Changed configure pre_processor method
code-dev05 9e12285
Merge remote-tracking branch 'up/main' into feature/model/glass
code-dev05 5466d46
Made some changes to the workflow of GLASS Model
code-dev05 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| """GLASS - Unsupervised anomaly detection via Gradient Ascent for Industrial Anomaly detection and localization. | ||
code-dev05 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| This module implements the GLASS model for unsupervised anomaly detection and localization. GLASS synthesizes both | ||
| global and local anomalies using Gaussian noise guided by gradient ascent to enhance weak defect detection in | ||
| industrial settings. | ||
| The model consists of: | ||
| - A feature extractor and feature adaptor to obtain robust normal representations | ||
| - A Global Anomaly Synthesis (GAS) module that perturbs features using Gaussian noise and gradient ascent with | ||
| truncated projection | ||
| - A Local Anomaly Synthesis (LAS) module that overlays augmented textures onto images using Perlin noise masks | ||
| - A shared discriminator trained with features from normal, global, and local synthetic samples | ||
| Paper: `A Unified Anomaly Synthesis Strategy with Gradient Ascent for Industrial Anomaly Detection and Localization | ||
| <https://arxiv.org/pdf/2407.09359>` | ||
| """ | ||
|
|
||
| # Copyright (C) 2025 Intel Corporation | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
code-dev05 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| from .lightning_model import Glass | ||
|
|
||
| __all__ = ["Glass"] | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.