Commit
·
18a30ca
1
Parent(s):
f10a6b7
Update watermarking_demoscript.py
Browse files- watermarking_demoscript.py +15 -0
watermarking_demoscript.py
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# demo_script.py
|
| 2 |
+
|
| 3 |
+
import tensorflow as tf
|
| 4 |
+
from watermarking_functions import detect_watermark_LSB
|
| 5 |
+
|
| 6 |
+
# Load the trained model with the embedded watermark
|
| 7 |
+
model_with_watermark = tf.keras.models.load_model('text_classification_model_with_watermark.h5')
|
| 8 |
+
|
| 9 |
+
# Detect and extract the watermark from the model
|
| 10 |
+
detected_watermark = detect_watermark_LSB(model_with_watermark)
|
| 11 |
+
|
| 12 |
+
if detected_watermark:
|
| 13 |
+
print("Watermark Detected:", detected_watermark)
|
| 14 |
+
else:
|
| 15 |
+
print("No watermark found or watermark detection failed.")
|