Upload README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
library_name: pytorch
|
| 4 |
+
tags:
|
| 5 |
+
- anomaly-detection
|
| 6 |
+
- zero-shot
|
| 7 |
+
- prompt-learning
|
| 8 |
+
- mvtec
|
| 9 |
+
- visa
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# Tipsomaly learned prompt checkpoints
|
| 13 |
+
|
| 14 |
+
Learned prompt weights for **TIPS Over Tricks: Simple Prompts for Effective Zero-shot Anomaly Detection** (Tipsomaly), trained using the MVTec AD and VisA datasets. These are auxiliary prompt checkpoints for the official [Tipsomaly PyTorch implementation](https://github.com/Alireza99Salehi/Tipsomaly); they are not standalone model weights and do not include the TIPS vision-language backbone.
|
| 15 |
+
|
| 16 |
+
**Paper:** [Hugging Face paper page](https://huggingface.co/papers/2602.03594) 路 [arXiv](https://arxiv.org/abs/2602.03594) 路 [IEEE](https://ieeexplore.ieee.org/document/11461758)
|
| 17 |
+
|
| 18 |
+
## Files
|
| 19 |
+
|
| 20 |
+
Each dataset directory contains training arguments and two learned-prompt checkpoints:
|
| 21 |
+
|
| 22 |
+
| Dataset | Files |
|
| 23 |
+
| --- | --- |
|
| 24 |
+
| MVTec AD | [`args.txt`](checkpoints/mvtec/args.txt), [`learnable_params_1.pth`](checkpoints/mvtec/learnable_params_1.pth), [`learnable_params_2.pth`](checkpoints/mvtec/learnable_params_2.pth) |
|
| 25 |
+
| VisA | [`args.txt`](checkpoints/visa/args.txt), [`learnable_params_1.pth`](checkpoints/visa/learnable_params_1.pth), [`learnable_params_2.pth`](checkpoints/visa/learnable_params_2.pth) |
|
| 26 |
+
|
| 27 |
+
`learnable_params_1.pth` and `learnable_params_2.pth` are saved at the end of training epochs 1 and 2, respectively. Each file stores the learned prompt tensor under the `learnable_prompts` key. The recorded training settings use 518-pixel images, the `concat` prompt-learning method, and segmentation loss.
|
| 28 |
+
|
| 29 |
+
## Use with the official implementation
|
| 30 |
+
|
| 31 |
+
Install and configure the dependencies, datasets, and TIPS backbone as described in the [GitHub repository](https://github.com/Alireza99Salehi/Tipsomaly#setup). From the Tipsomaly project directory, download a checkpoint set (replace `mvtec` with `visa` for the VisA-trained prompts):
|
| 32 |
+
|
| 33 |
+
```bash
|
| 34 |
+
hf download AlirezaSalehi99/Tipsomaly \
|
| 35 |
+
checkpoints/mvtec/args.txt \
|
| 36 |
+
checkpoints/mvtec/learnable_params_2.pth \
|
| 37 |
+
--local-dir .
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
Then pass the downloaded folder as `--checkpoint_path` and select the corresponding epoch:
|
| 41 |
+
|
| 42 |
+
```bash
|
| 43 |
+
python test.py \
|
| 44 |
+
--models_dir path/to/tips \
|
| 45 |
+
--checkpoint_path ./checkpoints/mvtec \
|
| 46 |
+
--data_root_dir path/to/data-root \
|
| 47 |
+
--dataset visa \
|
| 48 |
+
--epoch 2 \
|
| 49 |
+
--model_version l14h \
|
| 50 |
+
--fixed_prompt_type industrial
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
The repository's `test.py` loads the prompt tensor from `learnable_params_<epoch>.pth`; `args.txt` supplies the prompt-learning configuration. Use `--epoch 1` with `learnable_params_1.pth` if you download the epoch-1 checkpoint instead. The checkpoints contain learned prompts only; the TIPS backbone and evaluation datasets must be obtained separately.
|
| 54 |
+
|
| 55 |
+
## Training provenance
|
| 56 |
+
|
| 57 |
+
The checkpoint `args.txt` files record training with `prompt_learn_method=concat`, `cls_seg_los=seg`, seed 111, and image size 518. The MVTec and VisA weights were trained separately using their respective training datasets. See the paper and project repository for the method, full implementation, and experiment details.
|
| 58 |
+
|
| 59 |
+
## Citation
|
| 60 |
+
|
| 61 |
+
```bibtex
|
| 62 |
+
@article{salehi2026tips,
|
| 63 |
+
title={TIPS Over Tricks: Simple Prompts for Effective Zero-shot Anomaly Detection},
|
| 64 |
+
author={Salehi, Alireza and Karami, Ehsan and Noey, Sepehr and Noey, Sahand and Yamada, Makoto and Hosseini, Reshad and Sabokrou, Mohammad},
|
| 65 |
+
journal={arXiv preprint arXiv:2602.03594},
|
| 66 |
+
year={2026}
|
| 67 |
+
}
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
## License
|
| 71 |
+
|
| 72 |
+
The Tipsomaly project and these prompt checkpoints are released under the [MIT License](https://github.com/Alireza99Salehi/Tipsomaly/blob/main/LICENSE).
|