Datasets:
Tasks:
Other
Formats:
csv
Languages:
English
Size:
10K - 100K
ArXiv:
Tags:
watermarking
invisible-watermark
image-watermarking
owner-identification
image-provenance
content-provenance
License:
Every verdict of the Vereye benchmark on the SynthID-Image protocol (no images, no code)
5ab6d2e verified Download package/scripts/prep.py from Vereye/benchmark-synthid-image-protocol: direct link, hf CLI and curl.
- Browser
- Download file 695 Bytes
-
https://huggingface.co/datasets/Vereye/benchmark-synthid-image-protocol/resolve/main/package/scripts/prep.py
- Command line
-
hf download hf://datasets/Vereye/benchmark-synthid-image-protocol/package/scripts/prep.py
-
curl -L -o prep.py https://huggingface.co/datasets/Vereye/benchmark-synthid-image-protocol/resolve/main/package/scripts/prep.py
695 Bytes
| #!/usr/bin/env python3 | |
| """prep.py - makes a benchmark original from a public dataset photo: the centre square of the photo, BICUBIC-resized to the set's side | |
| (1024 or 512 px, Pillow), RGB. check.py --sources rebuilds every original this way and compares its pixels with the photo's info.json. | |
| python3 scripts/prep.py SRC_FILE OUT.png SIZE""" | |
| import sys | |
| from PIL import Image | |
| def prep(src, out, size): | |
| im = Image.open(src).convert('RGB'); w, h = im.size; s = min(w, h) | |
| im = im.crop(((w - s) // 2, (h - s) // 2, (w - s) // 2 + s, (h - s) // 2 + s)).resize((size, size), Image.BICUBIC); im.save(out); return im | |
| if __name__ == '__main__': | |
| prep(sys.argv[1], sys.argv[2], int(sys.argv[3])) | |