Datasets:
Update README.md
Browse files
README.md
CHANGED
@@ -26,21 +26,38 @@ The evaluation set is divided into 6 different categories:
|
|
26 |
```python
|
27 |
from huggingface_hub import snapshot_download
|
28 |
folder = snapshot_download(
|
29 |
-
"Shilin-LU/W-Bench",
|
30 |
-
repo_type="dataset",
|
31 |
-
local_dir="./W-Bench/",
|
32 |
-
allow_patterns="DET_INVERSION_1K/image/*"
|
|
|
33 |
```
|
34 |
|
35 |
For faster downloads, make sure to install `pip install huggingface_hub[hf_transfer]` and set the environment variable `HF_HUB_ENABLE_HF_TRANSFER=1`.
|
36 |
|
37 |
## Using `datasets`
|
38 |
|
|
|
39 |
```python
|
40 |
from datasets import load_dataset
|
41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
```
|
43 |
|
44 |
# Citation Information
|
45 |
Paper on [arXiv](https://arxiv.org/abs/2410.18775)
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
```python
|
27 |
from huggingface_hub import snapshot_download
|
28 |
folder = snapshot_download(
|
29 |
+
"Shilin-LU/W-Bench",
|
30 |
+
repo_type="dataset",
|
31 |
+
local_dir="./W-Bench/",
|
32 |
+
allow_patterns="DET_INVERSION_1K/image/*" # to download a specific branch
|
33 |
+
)
|
34 |
```
|
35 |
|
36 |
For faster downloads, make sure to install `pip install huggingface_hub[hf_transfer]` and set the environment variable `HF_HUB_ENABLE_HF_TRANSFER=1`.
|
37 |
|
38 |
## Using `datasets`
|
39 |
|
40 |
+
### 1. With Stream
|
41 |
```python
|
42 |
from datasets import load_dataset
|
43 |
+
dataset = load_dataset("Shilin-LU/W-Bench", split="train", streaming=True)
|
44 |
+
next(iter(dataset))['image'].save('output_stream.png')
|
45 |
+
```
|
46 |
+
|
47 |
+
### 2. Without Stream
|
48 |
+
```python
|
49 |
+
from datasets import load_dataset
|
50 |
+
dataset = load_dataset("Shilin-LU/W-Bench", split="train")
|
51 |
+
dataset[1]['image'].save('output.png')
|
52 |
```
|
53 |
|
54 |
# Citation Information
|
55 |
Paper on [arXiv](https://arxiv.org/abs/2410.18775)
|
56 |
+
```
|
57 |
+
@article{lu2024robust,
|
58 |
+
title={Robust watermarking using generative priors against image editing: From benchmarking to advances},
|
59 |
+
author={Lu, Shilin and Zhou, Zihan and Lu, Jiayou and Zhu, Yuanzhi and Kong, Adams Wai-Kin},
|
60 |
+
journal={arXiv preprint arXiv:2410.18775},
|
61 |
+
year={2024}
|
62 |
+
}
|
63 |
+
```
|