Skip to main content

UnReflectAnything

Project PyPI Paper Demo Modelcard Wiki Colab Licence

RGB-Only Highlight Removal by Rendering Synthetic Specular Supervision

UnReflectAnything inputs any RGB image and removes specular highlights, returning a clean diffuse-only output. We trained UnReflectAnything by synthetizing specularities and supervising in DINOv3 feature space.

UnReflectAnything works on both natural indoor and surgical/endoscopic domain data.


examples

[!IMPORTANT] The maintainers are still working on an official API and Weights release for UnReflectAnything. In v1.0.2 the model is available from the API with pretrained=False by deafault, and forecefully setting it True will display a warning and weights will not be downloaded. Stay tuned for the official release!

Installation

pip install unreflectanything

Install UnReflectAnything as a Python Package.

The minimum required Python version is 3.11, but development and all experiments have been based on Python 3.12.

For GPU support, make sure PyTorch comes with CUDA version for your system (see PyTorch Get Started).

Setting up

After pip-installing, you can use the unreflectanything CLI command, which is also aliased to unreflect and ura. The three commands are equivalent.

With the CLI you can already download the model weights with

unreflectanything download --weights

and some sample images with

unreflectanything download --images

Weights are stored by default in ~/.cache/unreflectanything/weights (or $XDG_CACHE_HOME/unreflectanything/weights if set ; %LOCALAPPDATA%\unreflectanything for Windows). Use --output-dir to choose another location.

Both the weights and images are stored on the HuggingFace Model Repo.

Enable shell completion

Shell completion is available for the bash and zsh shells. Run

unreflectanything completion bash

and execute the echo ... command that gets printed.

Command Line Interface

Get an overview of the available CLI endpoints with

unreflectanything --help   # alias 'unreflect --help' alias 'ura --help'

Refer to the Wiki to get detailed documentation about each endpoint. We report a summary of the available subcommands. Remember that ura is aliased to the unreflectanything command

Subcommand Description Command
inference Run inference on image(s) to remove reflections ura inference /path/to/images -o /path/to/output
download Download checkpoint weights, sample images, notebooks, configs ura download --weights
cache Print cache directory or clear cached assets ura cache --dir or ura cache --clear
verify Verify weights installation and compatibility, or dataset directory structure ura verify --weights or ura verify --dataset --path /path/to/dataset
cite Print citation (BibTeX, APA, MLA, IEEE, plain) ura cite --bibtex
completion Print or install shell completion (bash/zsh) ura completion bash

Training, testing, and evaluation are available via the Python API; see the Wiki for details.

Python API

The same endpoints above are exposed as a Python API. Refer to the Wiki to get detailed documentation about each endpoint. A few examples are reported below

import unreflectanything as unreflect
import torch

# Get the model class (e.g. for custom setup or training)
ModelClass = unreflect.model()

# Get a pretrained model (torch.nn.Module) and run on batched RGB
unreflectmodel = unreflect.model(pretrained=True)  # uses cached weights; run 'unreflect download --weights' first
images = torch.rand(2, 3, 448, 448, device="cuda")  # [B, 3, H, W], values in [0, 1]
model_out = unreflectmodel(images)  # [B, 3, H, W] diffuse tensor

# File-based or tensor-based inference (one-shot, no model handle)
unreflect.inference("input.png", output="output.png")
unreflect.inference(images, output="output.png")
result = unreflect.inference(images)

# Cache directory (where weights, images, etc. are stored)
weights_dir = unreflect.cache("weights")

Contributing & Development

If you want to contribute or develop UnReflectAnything:

  1. Clone the repository:
    git clone https://github.com/alberto-rota/UnReflectAnything.git
    cd UnReflectAnything
    
  2. Install dependencies (we recommend a virtual environment with Python 3.12):
    pip install -r requirements.txt
    

Citation

If you include UnReflectAnything in your pipeline or research work, we encourage you cite our work. Get the citation entry with

unreflectanything cite --bibtex

or copy it directly from below

@misc{rota2025unreflectanything,
      title={UnReflectAnything: RGB-Only Highlight Removal by Rendering Synthetic Specular Supervision}, 
      author={Alberto Rota and Mert Kiray and Mert Asim Karaoglu and Patrick Ruhkamp and Elena De Momi and Nassir Navab and Benjamin Busam},
      year={2025},
      eprint={2512.09583},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2512.09583}, 
}

Metadata

Release files for unreflectanything 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for unreflectanything 1.1.1
File Size Uploaded
unreflectanything-1.1.1.tar.gz 269.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for unreflectanything 1.1.1
File Interpreter ABI Platform
unreflectanything-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 559.9 kB

Release files / unreflectanything-1.1.1.tar.gz

Download URL unreflectanything-1.1.1.tar.gz
Size 269.6 kB
Tags Source
SHA-256 checksum
How to use checksums
24e92f8bf8deeab78d2b8c4974b96b113d668e37eccddf45e69ed958a5dc74de
BLAKE2b-256 checksum
How to use checksums
492bacc184f8b4fb3a48007a0a8ccfea1ec6d13bd643767d4d6ce3c311bf05b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.14

Release files / unreflectanything-1.1.1-py3-none-any.whl

Download URL unreflectanything-1.1.1-py3-none-any.whl
Size 290.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
589ffeba9e96d5c6be7e7e716d1f8e14ee77c9c6fb5a92fd4e2237e0bfb3e425
BLAKE2b-256 checksum
How to use checksums
286ca92fb2491cc0f549ac2114676471f573261dfd9f4122853d11c3b1f4d5b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.14

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.3.5

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page