Spaces:
Runtime error
Runtime error
Update fawkes_wrapper_gradio_v_1_0.py
Browse files
fawkes_wrapper_gradio_v_1_0.py
CHANGED
|
@@ -21,9 +21,11 @@ PREPROCESS = 'raw'
|
|
| 21 |
class FawkesProtection:
|
| 22 |
def __init__(self):
|
| 23 |
# Initialize Fawkes instances for different protection levels
|
| 24 |
-
self.fwks_l = Fawkes("extractor_2", '0', 1,
|
| 25 |
-
self.fwks_m = Fawkes("extractor_2", '0', 1,
|
| 26 |
-
self.fwks_h = Fawkes("extractor_2", '0', 1,
|
|
|
|
|
|
|
| 27 |
|
| 28 |
def generate_cloak_images(self, protector, image_X, target_emb=None):
|
| 29 |
cloaked_image_X = protector.compute(image_X, target_emb)
|
|
|
|
| 21 |
class FawkesProtection:
|
| 22 |
def __init__(self):
|
| 23 |
# Initialize Fawkes instances for different protection levels
|
| 24 |
+
self.fwks_l = Fawkes("extractor_2", '0', 1, protection_mode='low')
|
| 25 |
+
self.fwks_m = Fawkes("extractor_2", '0', 1, protection_mode='mid')
|
| 26 |
+
self.fwks_h = Fawkes("extractor_2", '0', 1, protection_mode='high')
|
| 27 |
+
|
| 28 |
+
# Rest of the code remains the same
|
| 29 |
|
| 30 |
def generate_cloak_images(self, protector, image_X, target_emb=None):
|
| 31 |
cloaked_image_X = protector.compute(image_X, target_emb)
|