Upload weights, notebooks, sample images
Browse files
README.md
CHANGED
|
@@ -17,9 +17,10 @@ tags:
|
|
| 17 |
[](https://huggingface.co/spaces/AlbeRota/UnReflectAnything)
|
| 18 |
[](https://huggingface.co/AlbeRota/UnReflectAnything)
|
| 19 |
[](https://github.com/alberto-rota/UnReflectAnything/wiki)
|
|
|
|
| 20 |
[](https://mit-license.org/)
|
| 21 |
|
| 22 |
-
UnReflectAnything inputs any RGB image and removes specular highlights, returning a clean diffuse-only
|
| 23 |
|
| 24 |
UnReflectAnything works on both natural indoor and surgical/endoscopic domain data.
|
| 25 |
|
|
@@ -69,32 +70,42 @@ to download the `.pth` weights in the package cache dir. The cache dir is usuall
|
|
| 69 |
### Basic Python Usage
|
| 70 |
|
| 71 |
```python
|
| 72 |
-
import unreflectanything
|
| 73 |
import torch
|
| 74 |
|
| 75 |
-
# Load the pretrained model (
|
| 76 |
-
|
| 77 |
|
| 78 |
# Run inference on a tensor [B, 3, H, W] in range [0, 1]
|
| 79 |
-
images = torch.rand(2, 3, 448, 448
|
| 80 |
-
diffuse_output =
|
| 81 |
|
| 82 |
-
#
|
| 83 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
```
|
| 85 |
-
Refer to the [Wiki](https://github.com/alberto-rota/UnReflectAnything/wiki) for
|
| 86 |
|
| 87 |
---
|
| 88 |
|
| 89 |
### CLI Overview
|
| 90 |
|
| 91 |
-
The package provides a
|
| 92 |
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
-
Refer to the [Wiki](https://github.com/alberto-rota/UnReflectAnything/wiki) for
|
| 98 |
|
| 99 |
---
|
| 100 |
|
|
|
|
| 17 |
[](https://huggingface.co/spaces/AlbeRota/UnReflectAnything)
|
| 18 |
[](https://huggingface.co/AlbeRota/UnReflectAnything)
|
| 19 |
[](https://github.com/alberto-rota/UnReflectAnything/wiki)
|
| 20 |
+
[](https://colab.research.google.com/#fileId=https%3A//huggingface.co/AlbeRota/UnReflectAnything/blob/main/notebooks/UnReflectAnything.ipynb)
|
| 21 |
[](https://mit-license.org/)
|
| 22 |
|
| 23 |
+
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.
|
| 24 |
|
| 25 |
UnReflectAnything works on both natural indoor and surgical/endoscopic domain data.
|
| 26 |
|
|
|
|
| 70 |
### Basic Python Usage
|
| 71 |
|
| 72 |
```python
|
| 73 |
+
import unreflectanything as ura
|
| 74 |
import torch
|
| 75 |
|
| 76 |
+
# Load the pretrained model (run 'ura download --weights' first)
|
| 77 |
+
model = ura.model(pretrained=True)
|
| 78 |
|
| 79 |
# Run inference on a tensor [B, 3, H, W] in range [0, 1]
|
| 80 |
+
images = torch.rand(2, 3, 448, 448, device="cuda")
|
| 81 |
+
diffuse_output = model(images) # [B, 3, H, W]
|
| 82 |
|
| 83 |
+
# File-based inference (one-shot)
|
| 84 |
+
ura.inference("input_with_highlights.png", output="diffuse_result.png")
|
| 85 |
+
# Tensor in, tensor out
|
| 86 |
+
result = ura.inference(images)
|
| 87 |
+
|
| 88 |
+
# Cache directory (where weights are stored)
|
| 89 |
+
weights_dir = ura.cache("weights")
|
| 90 |
```
|
| 91 |
+
Refer to the [Wiki](https://github.com/alberto-rota/UnReflectAnything/wiki) for full API and CLI documentation.
|
| 92 |
|
| 93 |
---
|
| 94 |
|
| 95 |
### CLI Overview
|
| 96 |
|
| 97 |
+
The package provides a command-line interface via `ura`, `unreflect`, or `unreflectanything`.
|
| 98 |
|
| 99 |
+
| Subcommand | Description | Example |
|
| 100 |
+
|------------|-------------|---------|
|
| 101 |
+
| `inference` | Run inference on image(s) to remove reflections | `ura inference /path/to/images -o /path/to/output` |
|
| 102 |
+
| `download` | Download weights, sample images, notebooks, configs | `ura download --weights` |
|
| 103 |
+
| `cache` | Print cache directory or clear cached assets | `ura cache --dir` or `ura cache --clear` |
|
| 104 |
+
| `verify` | Verify weights or dataset structure | `ura verify --weights` or `ura verify --dataset --path /path/to/dataset` |
|
| 105 |
+
| `cite` | Print citation (BibTeX, APA, etc.) | `ura cite --bibtex` |
|
| 106 |
+
| `completion` | Print or install shell completion (bash/zsh) | `ura completion bash` |
|
| 107 |
|
| 108 |
+
Training, testing, and evaluation are available via the [Python API](https://github.com/alberto-rota/UnReflectAnything/wiki). Refer to the [Wiki](https://github.com/alberto-rota/UnReflectAnything/wiki) for full CLI and API documentation.
|
| 109 |
|
| 110 |
---
|
| 111 |
|