Jacob Logas
commited on
hopefully fix requirements
Browse files
app.py
CHANGED
|
@@ -44,10 +44,6 @@ for root in model_roots:
|
|
| 44 |
|
| 45 |
|
| 46 |
@spaces.GPU(duration=120)
|
| 47 |
-
def execute(attack, tensor_img, dir_vec):
|
| 48 |
-
return attack.execute(tensor_img, dir_vec, direction).detach().cpu()
|
| 49 |
-
|
| 50 |
-
|
| 51 |
def protect(img, progress=gr.Progress(track_tqdm=True)):
|
| 52 |
models_attack, V_reduction, dim = prepare_models(
|
| 53 |
model_backbones,
|
|
@@ -110,7 +106,7 @@ def protect(img, progress=gr.Progress(track_tqdm=True)):
|
|
| 110 |
theta_warp=theta,
|
| 111 |
V_reduction=V_reduction,
|
| 112 |
)
|
| 113 |
-
img_attacked = execute(
|
| 114 |
|
| 115 |
img_attacked_pil = transforms.ToPILImage()(img_attacked[0])
|
| 116 |
return img_attacked_pil
|
|
|
|
| 44 |
|
| 45 |
|
| 46 |
@spaces.GPU(duration=120)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
def protect(img, progress=gr.Progress(track_tqdm=True)):
|
| 48 |
models_attack, V_reduction, dim = prepare_models(
|
| 49 |
model_backbones,
|
|
|
|
| 106 |
theta_warp=theta,
|
| 107 |
V_reduction=V_reduction,
|
| 108 |
)
|
| 109 |
+
img_attacked = attack.execute(tensor_img, dir_vec, direction).detach().cpu()
|
| 110 |
|
| 111 |
img_attacked_pil = transforms.ToPILImage()(img_attacked[0])
|
| 112 |
return img_attacked_pil
|