New model card
Browse files
README.md
CHANGED
|
@@ -5,58 +5,111 @@ tags:
|
|
| 5 |
- reflection-removal
|
| 6 |
- highlight-removal
|
| 7 |
- computer-vision
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
# UnReflectAnything
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
-
-
|
| 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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
| File | Description |
|
| 24 |
-
|
| 25 |
-
|
|
| 26 |
-
| `decoder_896.pth` | Decoder weights
|
| 27 |
-
| `
|
| 28 |
-
| `
|
| 29 |
-
| `
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
-
|
| 32 |
|
| 33 |
-
|
| 34 |
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
|
| 39 |
-
|
| 40 |
|
| 41 |
-
|
| 42 |
-
unreflectanything download-weights
|
| 43 |
-
```
|
| 44 |
|
| 45 |
-
|
|
|
|
|
|
|
| 46 |
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
unreflectanything download-weights
|
| 50 |
-
```
|
| 51 |
|
| 52 |
-
|
|
|
|
|
|
|
| 53 |
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
## Citation
|
| 57 |
|
| 58 |
-
If you use
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
-
|
|
|
|
|
|
|
| 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 |
+
[](https://alberto-rota.github.io/UnReflectAnything/)
|
| 15 |
+
[](https://pypi.org/project/unreflectanything/)
|
| 16 |
+
[](https://arxiv.org/abs/2512.09583)
|
| 17 |
+
[](https://huggingface.co/spaces/AlbeRota/UnReflectAnything)
|
| 18 |
+
[](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 |
+

|
| 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/).
|