How hanli6688/anomalylvm works
AnomalyLVM is presented as a unified zero-shot anomaly-detection framework for image classification and pixel-level localization, with industrial and medical dataset support. The visible workflow is training/validation in train.py, which requests datasets and evaluates a trainer; the trainer implementation and dataset registry are absent from the tree. model/model.py sketches visual feature fusion, localization, feature enhancement, and text-based scoring. The README documents broader capabilities, but several are placeholders in the sampled model; those implementation limits are reflected below.
Main entry points: model.py AnomalyLVM · train.py Train and validate · clip_model.py CLIP model · dataset Dataset adapters
Components 13
Dataset adapters
- Dataset adapters
dataset
Training workflow
- Train and validate
train.py
Anomaly model
- AnomalyLVM
model/model.py - Frozen SAM2 encoder
model/model.py - Frozen DINO-X encoder
model/model.py - Fusion decoder
model/model.py - Feature enhancement
model/model.py - Prompt learner
model/model.py - Frozen CLIP text
model/model.py - CLIP model
model/clip_model.py - Simple tokenizer
model/simple_tokenizer.py - CLIP utilities
model/utils.py
Other components
- Experiment operator
Connections 9
- Experiment operator → Train and validate: runs
train.py - Train and validate → Dataset adapters: requests data
train.py - AnomalyLVM → Frozen SAM2 encoder: extracts features
model/model.py - AnomalyLVM → Frozen DINO-X encoder: extracts features
model/model.py - AnomalyLVM → Fusion decoder: decodes features
model/model.py - AnomalyLVM → Feature enhancement: refines map
model/model.py - AnomalyLVM → Prompt learner: creates prompts
model/model.py - AnomalyLVM → Frozen CLIP text: encodes prompts
model/model.py - CLIP model → CLIP utilities: uses utilities
model/clip_model.py