AlbeRota commited on
Commit
965ab6e
·
verified ·
1 Parent(s): fb28997

Upload weights, notebooks, sample images

Browse files
Files changed (1) hide show
  1. README.md +25 -14
README.md CHANGED
@@ -17,9 +17,10 @@ tags:
17
  [![Demo](https://img.shields.io/badge/Demo-HF%20-FFD21E?logo=huggingface&logoColor=FFD21E)](https://huggingface.co/spaces/AlbeRota/UnReflectAnything)
18
  [![Modelcard](https://img.shields.io/badge/Model%20Card-HF%20-FFD21E?logo=huggingface&logoColor=FFD21E)](https://huggingface.co/AlbeRota/UnReflectAnything)
19
  [![Wiki](https://img.shields.io/badge/API-Wiki-9187FF?logo=wikipedia&logoColor=9187FF)](https://github.com/alberto-rota/UnReflectAnything/wiki)
 
20
  [![Licence](https://img.shields.io/badge/MIT-License-1E811F)](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,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 (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
 
 
17
  [![Demo](https://img.shields.io/badge/Demo-HF%20-FFD21E?logo=huggingface&logoColor=FFD21E)](https://huggingface.co/spaces/AlbeRota/UnReflectAnything)
18
  [![Modelcard](https://img.shields.io/badge/Model%20Card-HF%20-FFD21E?logo=huggingface&logoColor=FFD21E)](https://huggingface.co/AlbeRota/UnReflectAnything)
19
  [![Wiki](https://img.shields.io/badge/API-Wiki-9187FF?logo=wikipedia&logoColor=9187FF)](https://github.com/alberto-rota/UnReflectAnything/wiki)
20
+ [![Colab](https://img.shields.io/badge/Examples-Colab-F9AB00?logo=googlecolab&logoColor=F9AB00)](https://colab.research.google.com/#fileId=https%3A//huggingface.co/AlbeRota/UnReflectAnything/blob/main/notebooks/UnReflectAnything.ipynb)
21
  [![Licence](https://img.shields.io/badge/MIT-License-1E811F)](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