Skip to content
Open
Show file tree
Hide file tree
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 Mar 26, 2025
4789f49
Created the trainer class for glass model
code-dev05 Apr 14, 2025
050fd4c
Added suggested changes
code-dev05 Apr 27, 2025
cdd0984
Modified forward method for model
code-dev05 Apr 27, 2025
381eec6
Fixed backbone loading logic
code-dev05 Apr 30, 2025
9b1c51a
Added type for input shape
code-dev05 May 4, 2025
161005c
Fixed bugs
code-dev05 May 4, 2025
3d78beb
Merge branch 'main' into feature/model/glass
samet-akcay May 7, 2025
617cf49
Changed files as needed
code-dev05 May 13, 2025
f9d3207
Merge remote-tracking branch 'origin/feature/model/glass' into featur…
code-dev05 May 13, 2025
7fea20f
Matched code to the original implementation
code-dev05 Jun 19, 2025
1beedf5
Added support for gpu
code-dev05 Jun 23, 2025
838bc50
Refactored code from lightning model to torch model
code-dev05 Jul 1, 2025
1baa0b7
GPU bug fixed
code-dev05 Jul 2, 2025
f066b3c
used image device in torch model
code-dev05 Jul 2, 2025
6e780b0
fixed bug
code-dev05 Jul 2, 2025
b1be6f5
Added validation step
code-dev05 Jul 11, 2025
20d97dd
Merge branch 'main' into feature/model/glass
samet-akcay Jul 14, 2025
d5affe4
Refactored code for better readability
code-dev05 Jul 28, 2025
f008537
Merge remote-tracking branch 'origin/feature/model/glass' into featur…
code-dev05 Jul 28, 2025
a1097e5
Set automatic optimization to False and made component functions
code-dev05 Jul 31, 2025
7e9d4d4
Resolved third-party-programs.txt conflict
code-dev05 Aug 5, 2025
44dcd60
Added automated download for dtd dataset in Glass Model
code-dev05 Aug 12, 2025
da57095
Removed some input args
code-dev05 Aug 14, 2025
ba5a6dd
Change in default parameters
code-dev05 Aug 14, 2025
714a3c3
Fixed default backbone name
code-dev05 Aug 14, 2025
1a3519c
Changed configure pre_processor method
code-dev05 Aug 14, 2025
9e12285
Merge remote-tracking branch 'up/main' into feature/model/glass
code-dev05 Sep 13, 2025
5466d46
Made some changes to the workflow of GLASS Model
code-dev05 Sep 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/anomalib/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
Fastflow,
Fre,
Ganomaly,
Glass,
Padim,
Patchcore,
ReverseDistillation,
Expand Down Expand Up @@ -102,6 +103,7 @@ class UnknownModelError(ModuleNotFoundError):
"Fastflow",
"Fre",
"Ganomaly",
"Glass",
"Padim",
"Patchcore",
"ReverseDistillation",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

from .timm import TimmFeatureExtractor
from .utils import dryrun_find_featuremap_dims

__all__ = [
"dryrun_find_featuremap_dims",
"TimmFeatureExtractor",
Expand Down
4 changes: 3 additions & 1 deletion src/anomalib/models/image/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
from .fastflow import Fastflow
from .fre import Fre
from .ganomaly import Ganomaly
from .glass import Glass
from .padim import Padim
from .patchcore import Patchcore
from .reverse_distillation import ReverseDistillation
Expand All @@ -76,12 +77,13 @@
"Fastflow",
"Fre",
"Ganomaly",
"Glass",
"Padim",
"Patchcore",
"ReverseDistillation",
"Stfpm",
"Supersimplenet",
"Uflow",
"VlmAd",
"WinClip",
"WinClip"
]
23 changes: 23 additions & 0 deletions src/anomalib/models/image/glass/__init__.py
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.
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

from .lightning_model import Glass

__all__ = ["Glass"]
Loading