Omnibus commited on
Commit
5558d7a
1 Parent(s): 4f3d9c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -127,13 +127,14 @@ def tot_prob():
127
  except Exception as e:
128
  pass
129
  print (e)
 
130
  def fin_clear():
131
  fin_sum.clear()
132
-
133
  with gr.Blocks() as app:
134
  gr.Markdown("""<center><h1>AI Image Detector<br><h4>(Test Demo - accuracy varies by model)""")
135
  with gr.Column():
136
- inp = gr.Pil()
137
  in_url=gr.Textbox(label="Image URL")
138
  with gr.Row():
139
  load_btn=gr.Button("Load URL")
@@ -164,7 +165,7 @@ with gr.Blocks() as app:
164
  n_out2=gr.Label(label="Output")
165
  outp2 = gr.HTML("""""")
166
 
167
- fin.change(fin_clear,None,None)
168
  load_btn.click(load_url,in_url,[inp,mes])
169
  btn.click(aiornot0,[inp],[outp0,n_out0]).then(tot_prob,None,fin)
170
  btn.click(aiornot1,[inp],[outp1,n_out1]).then(tot_prob,None,fin)
 
127
  except Exception as e:
128
  pass
129
  print (e)
130
+ return None
131
  def fin_clear():
132
  fin_sum.clear()
133
+ return None
134
  with gr.Blocks() as app:
135
  gr.Markdown("""<center><h1>AI Image Detector<br><h4>(Test Demo - accuracy varies by model)""")
136
  with gr.Column():
137
+ inp = gr.Image(type='numpy')
138
  in_url=gr.Textbox(label="Image URL")
139
  with gr.Row():
140
  load_btn=gr.Button("Load URL")
 
165
  n_out2=gr.Label(label="Output")
166
  outp2 = gr.HTML("""""")
167
 
168
+ btn.click(fin_clear,None,fin)
169
  load_btn.click(load_url,in_url,[inp,mes])
170
  btn.click(aiornot0,[inp],[outp0,n_out0]).then(tot_prob,None,fin)
171
  btn.click(aiornot1,[inp],[outp1,n_out1]).then(tot_prob,None,fin)