Merge branch 'main' of https://huggingface.co/leonelhs/zeroscratches
Browse files
README.md
CHANGED
@@ -1,3 +1,30 @@
|
|
1 |
---
|
2 |
license: mit
|
3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
license: mit
|
3 |
---
|
4 |
+
|
5 |
+
# Zero Scratches
|
6 |
+
## Old Photo Restoration
|
7 |
+
|
8 |
+
This is a compated version of [Microsoft Bringing Old Photos Back to Life](https://github.com/microsoft/Bringing-Old-Photos-Back-to-Life)
|
9 |
+
|
10 |
+
|
11 |
+
### Install
|
12 |
+
```shell
|
13 |
+
pip install zeroscatches
|
14 |
+
```
|
15 |
+
### Basic usage
|
16 |
+
```python
|
17 |
+
|
18 |
+
import PIL.Image
|
19 |
+
from zeroscratches import EraseScratches
|
20 |
+
|
21 |
+
|
22 |
+
image_path = "/path/to/image-scratched.jpg"
|
23 |
+
eraser = EraseScratches()
|
24 |
+
|
25 |
+
image = PIL.Image.open(image_path)
|
26 |
+
new_img = eraser.erase(image)
|
27 |
+
|
28 |
+
new_img = PIL.Image.fromarray(new_img)
|
29 |
+
new_img.show()
|
30 |
+
```
|