Downloads · 30 days
21
0% of all-time downloads
imatag/stable-signature-bzh-detector-resnet18
stable-signature-bzh-detector-resnet18 is a image classification model from imatag. Use it when you need a label for an image. It is set up for transformers. The card lists the license as mit.
You can use this classifier to detect watermarks generated with our SDXL-turbo watermarking demo.
Downloads · 30 days
21
0% of all-time downloads
All-time downloads
10.3K
Public
Repo size
274 MB
Likes
4
Public
Click a slice to open those files.
.bin44.8 MB · 94%
From the Hugging Face model README
You can use this classifier to detect watermarks generated with our SDXL-turbo watermarking demo.
from transformers import AutoModelForImageClassification, BlipImageProcessor
from PIL import Image
import sys
image_processor = BlipImageProcessor.from_pretrained("imatag/stable-signature-bzh-detector-resnet18")
model = AutoModelForImageClassification.from_pretrained("imatag/stable-signature-bzh-detector-resnet18")
model.eval()
img = Image.open(sys.argv[1]).convert("RGB")
inputs = image_processor(img, return_tensors="pt")
p = model(**inputs).logits[0,0] < 0
print(f"watermarked: {p}")
This model is an approximate version of IMATAG's BZH decoder for the watermark embedded in our SDXL-turbo watermarking demo. It works on this watermark only and cannot be used to decode other watermarks.
It will catch most altered versions of a watermarked image while making roughly one mistake in one thousand on non-watermarked images. Alternatively, it can produce an approximate p-value measuring the risk of mistakenly detecting a watermark on a benign (non-watermarked) image, by recalibrating the output as in this script.
To get an exact p-value and for improved robustness, please use the API instead.
For more details on this watermarking technique, check out our announcement and our lab's blog post.
For watermarked models with a different key, support for payload, other perceptual compromises, robustness to other attacks, or faster detection, please contact IMATAG.