Jacob Logas commited on
Commit
c709975
·
1 Parent(s): fc10802

Debug printing for huggingface tmp directory exploration

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -1,11 +1,13 @@
1
  from fawkes.protection import Fawkes
2
  import gradio as gr
 
3
 
4
  def predict(level, img):
5
  print(img)
6
  fwks = Fawkes("extractor_2", '0', 1, mode=level)
7
  fwks.run_protection([img], format='jpeg')
8
  splt = img.split(".")
 
9
  return splt[0] + "_cloaked." + splt[1]
10
 
11
  gr.Interface(fn=predict, inputs=[gr.inputs.Dropdown(["low", "mid", "high"], label="Protection Level"), gr.inputs.Image(type='filepath')], outputs=gr.outputs.Image(type="pil")).launch(share=True)
 
1
  from fawkes.protection import Fawkes
2
  import gradio as gr
3
+ import os
4
 
5
  def predict(level, img):
6
  print(img)
7
  fwks = Fawkes("extractor_2", '0', 1, mode=level)
8
  fwks.run_protection([img], format='jpeg')
9
  splt = img.split(".")
10
+ print(os.listdir('/tmp'))
11
  return splt[0] + "_cloaked." + splt[1]
12
 
13
  gr.Interface(fn=predict, inputs=[gr.inputs.Dropdown(["low", "mid", "high"], label="Protection Level"), gr.inputs.Image(type='filepath')], outputs=gr.outputs.Image(type="pil")).launch(share=True)