Omnibus commited on
Commit
c0cd7e7
1 Parent(s): e793dfb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -59,7 +59,11 @@ def aiornot0(image):
59
  Probabilites:<br>
60
  Real: {px[0][0]}<br>
61
  AI: {px[1][0]}"""
62
- return gr.HTML.update(html_out)
 
 
 
 
63
  def aiornot1(image):
64
  labels = ["Real", "AI"]
65
  mod=models[1]
@@ -120,10 +124,10 @@ with gr.Blocks() as app:
120
  lab2 = gr.HTML(f"""Testing on Model: {models[2]}""")
121
  outp2 = gr.HTML("""""")
122
  n_out2=gr.Label()
123
- btn.click(aiornot0,[inp],outp0)
124
  btn.click(aiornot1,[inp],outp1)
125
  btn.click(aiornot2,[inp],outp2)
126
- btn.click(image_classifier0,[inp],n_out0)
127
  btn.click(image_classifier1,[inp],n_out1)
128
  btn.click(image_classifier2,[inp],n_out2)
129
  app.launch()
 
59
  Probabilites:<br>
60
  Real: {px[0][0]}<br>
61
  AI: {px[1][0]}"""
62
+ results = {}
63
+ for idx,result in enumerate(px):
64
+ results[labels[idx]] = pdx[idx][0]
65
+ #results[labels['label']] = result['score']
66
+ return gr.HTML.update(html_out),results
67
  def aiornot1(image):
68
  labels = ["Real", "AI"]
69
  mod=models[1]
 
124
  lab2 = gr.HTML(f"""Testing on Model: {models[2]}""")
125
  outp2 = gr.HTML("""""")
126
  n_out2=gr.Label()
127
+ btn.click(aiornot0,[inp],[outp0,n_out0])
128
  btn.click(aiornot1,[inp],outp1)
129
  btn.click(aiornot2,[inp],outp2)
130
+ #btn.click(image_classifier0,[inp],n_out0)
131
  btn.click(image_classifier1,[inp],n_out1)
132
  btn.click(image_classifier2,[inp],n_out2)
133
  app.launch()