AnsenH commited on
Commit
1cd2670
·
1 Parent(s): 4d87dd1

chore: restructure readme, folders

Browse files
README.md CHANGED
@@ -10,5 +10,9 @@ app_file: app.py
10
  pinned: false
11
  license: apache-2.0
12
  ---
13
-
14
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
10
  pinned: false
11
  license: apache-2.0
12
  ---
13
+ # Reference
14
+ - [Steganography](https://github.com/kelvins/steganography)
15
+ - [Watermarking Images in Self-Supervised Latent-Spaces](https://arxiv.org/pdf/2112.09581.pdf)
16
+ * [Github](https://github.com/facebookresearch/ssl_watermarking)
17
+ * [HuggingFace Space](https://huggingface.co/spaces/pierrefdz/ssl_watermarking)
18
+ * [Explanation](https://pierrefdz.github.io/publications/sslwatermarking/)
SSL_watermark.py CHANGED
@@ -4,8 +4,8 @@ import json
4
  import torch
5
  from torchvision import transforms
6
 
7
- import torch_utils
8
- import image_utils
9
 
10
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
11
 
@@ -13,8 +13,8 @@ torch.manual_seed(0)
13
  np.random.seed(0)
14
 
15
  print('Building backbone and normalization layer...')
16
- backbone = torch_utils.build_backbone(path='dino_r50.pth')
17
- normlayer = torch_utils.load_normalization_layer(path='out2048.pth')
18
  model = torch_utils.NormLayerWrapper(backbone, normlayer)
19
 
20
  print('Building the hypercone...')
 
4
  import torch
5
  from torchvision import transforms
6
 
7
+ import util_functions.torch_utils as torch_utils
8
+ import util_functions.image_utils as image_utils
9
 
10
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
11
 
 
13
  np.random.seed(0)
14
 
15
  print('Building backbone and normalization layer...')
16
+ backbone = torch_utils.build_backbone(path='models/dino_r50.pth')
17
+ normlayer = torch_utils.load_normalization_layer(path='models/out2048.pth')
18
  model = torch_utils.NormLayerWrapper(backbone, normlayer)
19
 
20
  print('Building the hypercone...')
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import gradio as gr
2
  from steganography import Steganography
3
- from utils import draw_multiple_line_text, generate_qr_code
4
  from SSL_watermark import encode, decode
5
 
6
 
 
1
  import gradio as gr
2
  from steganography import Steganography
3
+ from util_functions.utils import draw_multiple_line_text, generate_qr_code
4
  from SSL_watermark import encode, decode
5
 
6
 
dino_r50.pth → models/dino_r50.pth RENAMED
File without changes
out2048.pth → models/out2048.pth RENAMED
File without changes
util_functions/__pycache__/image_utils.cpython-311.pyc ADDED
Binary file (6.14 kB). View file
 
util_functions/__pycache__/torch_utils.cpython-311.pyc ADDED
Binary file (5.91 kB). View file
 
util_functions/__pycache__/utils.cpython-311.pyc ADDED
Binary file (1.92 kB). View file
 
image_utils.py → util_functions/image_utils.py RENAMED
File without changes
torch_utils.py → util_functions/torch_utils.py RENAMED
File without changes
utils.py → util_functions/utils.py RENAMED
File without changes