Views
No views yet
1@article{bergmann2021mvtec,
2 title={The MVTec Anomaly Detection Dataset: A Comprehensive Real-World Dataset for Unsupervised Anomaly Detection},
3 author={Bergmann, Paul and Batzner, Kilian and Fauser, Michael and Sattlegger, David and Steger, Carsten},
4 journal={International Journal of Computer Vision},
5 year={2021}
6}| Category | Checkpoint |
|---|---|
| Bottle | model_bottle_64.pt |
| Cable | model_cable_64.pt |
| Capsule | model_capsule_64.pt |
| Carpet | model_carpet_64.pt |
| Grid | model_grid_64.pt |
| Hazelnut | model_hazelnut_64.pt |
| Leather | model_leather_64.pt |
| Metal Nut | model_metal_nut_64.pt |
| Pill | model_pill_64.pt |
| Screw | model_screw_64.pt |
| Tile | model_tile_64.pt |
| Toothbrush | model_toothbrush_64.pt |
| Transistor | model_transistor_64.pt |
| Wood | model_wood_64.pt |
| Zipper | model_zipper_64.pt |
| Property | Value |
|---|---|
| Model | VAE-GAN |
| Training Setting | One-Class Learning |
| Training Data | Normal Samples Only |
| Input Size | 128 × 128 × 3 |
| Latent Dimension | 64 |
| Framework | PyTorch |
1{
2 "encoder_state_dict": ...,
3 "decoder_state_dict": ...,
4 "discriminator_state_dict": ...
5}1import torch
2
3checkpoint = torch.load(
4 "model_bottle_64.pt",
5 map_location="cpu",
6 weights_only=False
7)
8
9encoder.load_state_dict(checkpoint["encoder_state_dict"])
10decoder.load_state_dict(checkpoint["decoder_state_dict"])
11discriminator.load_state_dict(checkpoint["discriminator_state_dict"])
12
13encoder.eval()
14decoder.eval()
15discriminator.eval()1with torch.no_grad():
2 mu, logvar = encoder(image)
3 z = reparameterize(mu, logvar)
4 reconstruction = decoder(z)
5
6anomaly_map = torch.abs(image - reconstruction).mean(dim=1)
7anomaly_score = anomaly_map.mean().item()1import torch
2
3if torch.cuda.is_available():
4 device = "cuda"
5elif torch.backends.mps.is_available():
6 device = "mps"
7else:
8 device = "cpu"1@misc{rao2026vaeganmvtec,
2 title={VAE-GAN Checkpoints for MVTec Anomaly Detection},
3 author={Rao, Rashid},
4 year={2026},
5 publisher={Hugging Face},
6 url={https://huggingface.co/rashidrao/AnomalyDetection}
7}