Upload weights, notebooks, sample images
Browse files
README.md
CHANGED
|
@@ -17,10 +17,9 @@ tags:
|
|
| 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
|
| 24 |
|
| 25 |
UnReflectAnything works on both natural indoor and surgical/endoscopic domain data.
|
| 26 |
|
|
@@ -70,42 +69,32 @@ to download the `.pth` weights in the package cache dir. The cache dir is usuall
|
|
| 70 |
### Basic Python Usage
|
| 71 |
|
| 72 |
```python
|
| 73 |
-
import unreflectanything
|
| 74 |
import torch
|
| 75 |
|
| 76 |
-
# Load the pretrained model (
|
| 77 |
-
|
| 78 |
|
| 79 |
# Run inference on a tensor [B, 3, H, W] in range [0, 1]
|
| 80 |
-
images = torch.rand(2, 3, 448, 448
|
| 81 |
-
diffuse_output =
|
| 82 |
|
| 83 |
-
#
|
| 84 |
-
|
| 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
|
| 92 |
|
| 93 |
---
|
| 94 |
|
| 95 |
### CLI Overview
|
| 96 |
|
| 97 |
-
The package provides a command-line interface via `ura`, `unreflect`, or `unreflectanything`.
|
| 98 |
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 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 |
-
|
| 109 |
|
| 110 |
---
|
| 111 |
|
|
|
|
| 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 outputs. We trained UnReflectAnything by synthetizing specularities and supervising in DINOv3 feature space.
|
| 23 |
|
| 24 |
UnReflectAnything works on both natural indoor and surgical/endoscopic domain data.
|
| 25 |
|
|
|
|
| 69 |
### Basic Python Usage
|
| 70 |
|
| 71 |
```python
|
| 72 |
+
import unreflectanything
|
| 73 |
import torch
|
| 74 |
|
| 75 |
+
# Load the pretrained model (uses cached weights)
|
| 76 |
+
unreflect_model = unreflectanything.model()
|
| 77 |
|
| 78 |
# Run inference on a tensor [B, 3, H, W] in range [0, 1]
|
| 79 |
+
images = torch.rand(2, 3, 448, 448).cuda()
|
| 80 |
+
diffuse_output = unreflect_model(images)
|
| 81 |
|
| 82 |
+
# Simple file-based inference
|
| 83 |
+
unreflectanything.inference("input_with_highlights.png", output="diffuse_result.png")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
```
|
| 85 |
+
Refer to the [Wiki](https://github.com/alberto-rota/UnReflectAnything/wiki) for all details on the API endpoints
|
| 86 |
|
| 87 |
---
|
| 88 |
|
| 89 |
### CLI Overview
|
| 90 |
|
| 91 |
+
The package provides a comprehensive command-line interface via `ura`, `unreflect`, or `unreflectanything`.
|
| 92 |
|
| 93 |
+
* **Inference**: `ura inference --input /path/to/images --output /path/to/output`
|
| 94 |
+
* **Evaluation**: `ura evaluate --output /path/to/results --gt /path/to/groundtruth`
|
| 95 |
+
* **Verification**: `ura verify --dataset /path/to/dataset`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
+
Refer to the [Wiki](https://github.com/alberto-rota/UnReflectAnything/wiki) for all details on the CLI endpoints
|
| 98 |
|
| 99 |
---
|
| 100 |
|