Spaces:
Build error
Build error
Download stable_diffusion/scripts/tests/test_watermark.py from Examplejohn/Diffree: direct link, hf CLI and curl.
- Browser
- Download file 357 Bytes
-
https://huggingface.co/spaces/Examplejohn/Diffree/resolve/cbae96701301a46cfd385a781b47a0416b451d21/stable_diffusion/scripts/tests/test_watermark.py
- Command line
-
hf download hf://spaces/Examplejohn/Diffree@cbae96701301a46cfd385a781b47a0416b451d21/stable_diffusion/scripts/tests/test_watermark.py
-
curl -L -o test_watermark.py https://huggingface.co/spaces/Examplejohn/Diffree/resolve/cbae96701301a46cfd385a781b47a0416b451d21/stable_diffusion/scripts/tests/test_watermark.py
357 Bytes
| import cv2 | |
| import fire | |
| from imwatermark import WatermarkDecoder | |
| def testit(img_path): | |
| bgr = cv2.imread(img_path) | |
| decoder = WatermarkDecoder('bytes', 136) | |
| watermark = decoder.decode(bgr, 'dwtDct') | |
| try: | |
| dec = watermark.decode('utf-8') | |
| except: | |
| dec = "null" | |
| print(dec) | |
| if __name__ == "__main__": | |
| fire.Fire(testit) |