AlbeRota commited on
Commit
222d18b
·
1 Parent(s): 1a6253d

New model card

Browse files
Files changed (1) hide show
  1. README.md +86 -33
README.md CHANGED
@@ -5,58 +5,111 @@ tags:
5
  - reflection-removal
6
  - highlight-removal
7
  - computer-vision
 
 
8
  ---
9
 
10
- # UnReflectAnything Pretrained Weights
11
 
12
- Pretrained weights for **UnReflectAnything**: *RGB-Only Highlight Removal by Rendering Synthetic Specular Supervision*.
 
 
 
 
13
 
14
- - **Project**: [alberto-rota.github.io/UnReflectAnything](https://alberto-rota.github.io/UnReflectAnything/)
15
- - **Paper**: [arXiv](https://arxiv.org/abs/2501.12345)
16
- - **PyPI**: `pip install unreflectanything`
17
- - **Demo**: [Hugging Face Space](https://huggingface.co/spaces/AlbeRota/UnReflectAnything)
18
 
19
- ## Model description
 
 
 
 
 
 
 
20
 
21
- These weights support the `unreflectanything` package for removing specular highlights and reflections from RGB images without polarization or multi-view input.
 
 
 
22
 
23
  | File | Description |
24
- |------|-------------|
25
- | `fullmodel_896.pt` | Full model checkpoint (recommended for inference) |
26
- | `decoder_896.pth` | Decoder weights (896px; e.g. for pretraining) |
27
- | `rgb_decoder.pth` | RGB decoder weights |
28
- | `rgb_film_decoder.pth` | RGB FiLM decoder weights |
29
- | `token_inpainter.pth` | Token inpainter module weights |
 
 
 
 
 
 
 
 
 
 
 
 
30
 
31
- ## How to use
32
 
33
- 1. **Install the package** (with optional weight-download support):
34
 
35
- ```bash
36
- pip install unreflectanything[weights]
37
- ```
38
 
39
- 2. **Download these weights** into the default cache:
40
 
41
- ```bash
42
- unreflectanything download-weights
43
- ```
44
 
45
- By default the CLI uses the official weights repo. To use this Hugging Face repo instead, set:
 
 
46
 
47
- ```bash
48
- export UNREFLECTANYTHING_WEIGHTS_REPO="<your-username>/<this-repo-name>"
49
- unreflectanything download-weights
50
- ```
51
 
52
- Weights are stored under `~/.cache/unreflectanything/weights` (or `$XDG_CACHE_HOME/unreflectanything/weights`). Use `--output-dir` to override.
 
 
53
 
54
- 3. **Run inference** with a YAML config that points `weights_path` to the downloaded directory (e.g. to `fullmodel_896.pt` for full-model inference).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
 
56
  ## Citation
57
 
58
- If you use these weights or the method, please cite the paper and/or link to this repository.
 
 
 
 
 
 
 
 
 
 
 
59
 
60
- ## License
 
 
61
 
62
- MIT.
 
5
  - reflection-removal
6
  - highlight-removal
7
  - computer-vision
8
+ - dinov3
9
+ - surgical-imaging
10
  ---
11
 
12
+ # UnReflectAnything: RGB-Only Highlight Removal
13
 
14
+ [![Project](https://img.shields.io/badge/Project-webpage-ff611b?logo=googlehome&logoColor=ff611b)](https://alberto-rota.github.io/UnReflectAnything/)
15
+ [![PyPI](https://img.shields.io/badge/pip%20install-PyPI-76b1f3?logo=python&logoColor=76b1f3)](https://pypi.org/project/unreflectanything/)
16
+ [![Paper](https://img.shields.io/badge/Paper-arXiv-B31B1B?logo=arxiv&logoColor=B31B1B)](https://arxiv.org/abs/2512.09583)
17
+ [![Weights](https://img.shields.io/badge/Weights-HF%20-FFD21E?logo=huggingface&logoColor=FFD21E)](https://huggingface.co/spaces/AlbeRota/UnReflectAnything)
18
+ [![Demo](https://img.shields.io/badge/Demo-HF%20-FFD21E?logo=huggingface&logoColor=FFD21E)](https://huggingface.co/AlbeRota/UnReflectAnything)
19
 
20
+ **UnReflectAnything** is a foundation-model-powered framework that inputs any RGB image and removes specular highlights, returning a clean, diffuse-only output. Unlike traditional methods, it does not require polarization or multi-view data.
 
 
 
21
 
22
+ ---
23
+
24
+ ## Model Capabilities
25
+ * **Domain Versatility**: Works effectively on both natural indoor scenes and specialized surgical/endoscopic domain data.
26
+ * **Synthetic Supervision**: Trained by synthesizing specularities and supervising the reconstruction in the **DINOv3 feature space**.
27
+ * **Foundation Power**: Leverages robust feature representations to generalize highlight removal across diverse lighting conditions.
28
+
29
+ ![Architecture](https://raw.githubusercontent.com/alberto-rota/UnReflectAnything/refs/heads/main/assets/architecture.png)
30
 
31
+ ---
32
+
33
+ ## Available Weights
34
+ The following checkpoints are provided for different integration needs:
35
 
36
  | File | Description |
37
+ | :--- | :--- |
38
+ | **`fullmodel_896.pt`** | Full model checkpoint; recommended for standard inference. |
39
+ | `decoder_896.pth` | Decoder weights optimized for 896px resolution. |
40
+ | `token_inpainter.pth` | Weights for the specialized token inpainter module. |
41
+ | `rgb_decoder.pth` | Standard RGB decoder weights. |
42
+ | `rgb_film_decoder.pth` | RGB FiLM (Feature-wise Linear Modulation) decoder weights. |
43
+
44
+ ---
45
+
46
+ ## Installation & Quick Start
47
+
48
+ ### 1. Install via pip
49
+ ```bash
50
+ pip install unreflectanything
51
+
52
+ ```
53
+
54
+ *Note: Minimum Python 3.11 is required; 3.12 is recommended.*
55
 
56
+ ### 2. Download Weights
57
 
58
+ Use the built-in CLI to fetch the necessary files:
59
 
60
+ ```bash
61
+ # Alias 'ura' or 'unreflect' also work
62
+ unreflectanything download --weights
63
 
64
+ ```
65
 
66
+ ### 3. Basic Python Usage
 
 
67
 
68
+ ```python
69
+ import unreflectanything
70
+ import torch
71
 
72
+ # Load the pretrained model (uses cached weights)
73
+ unreflect_model = unreflectanything.model(pretrained=True)
 
 
74
 
75
+ # Run inference on a tensor [B, 3, H, W] in range [0, 1]
76
+ images = torch.rand(2, 3, 448, 448).cuda()
77
+ diffuse_output = unreflect_model(images)
78
 
79
+ # Simple file-based inference
80
+ unreflectanything.inference("input_with_highlights.png", output="diffuse_result.png")
81
+
82
+ ```
83
+
84
+ ---
85
+
86
+ ## CLI Overview
87
+
88
+ The package provides a comprehensive command-line interface via `ura`, `unreflect`, or `unreflectanything`.
89
+
90
+ * **Inference**: `ura inference --input /path/to/images --output /path/to/output`
91
+ * **Evaluation**: `ura evaluate --output /path/to/results --gt /path/to/groundtruth`
92
+ * **Verification**: `ura verify --dataset /path/to/dataset`
93
+
94
+ ---
95
 
96
  ## Citation
97
 
98
+ If you use UnReflectAnything in your research or pipeline, please cite our paper:
99
+
100
+ ```bibtex
101
+ @misc{rota2025unreflectanythingrgbonlyhighlightremoval,
102
+ title={UnReflectAnything: RGB-Only Highlight Removal by Rendering Synthetic Specular Supervision},
103
+ author={Alberto Rota and Mert Kiray and Mert Asim Karaoglu and Patrick Ruhkamp and Elena De Momi and Nassir Navab and Benjamin Busam},
104
+ year={2025},
105
+ eprint={2512.09583},
106
+ archivePrefix={arXiv},
107
+ primaryClass={cs.CV},
108
+ url={[https://arxiv.org/abs/2512.09583](https://arxiv.org/abs/2512.09583)},
109
+ }
110
 
111
+ ```
112
+
113
+ ---
114
 
115
+ **License**: This project is licensed under the [MIT License](https://mit-license.org/).