Omnibus commited on
Commit
d87e4e8
1 Parent(s): e705b06

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -52,8 +52,8 @@ def aiornot0(image):
52
  for idx,result in enumerate(px):
53
  results[labels[idx]] = px[idx][0]
54
  #results[labels['label']] = result['score']
55
- tmp_res={f'{uid}-0':results}
56
- fin_sum.append(tmp_res)
57
  return gr.HTML.update(html_out),results
58
  def aiornot1(image):
59
  labels = ["Real", "AI"]
@@ -78,8 +78,8 @@ def aiornot1(image):
78
  for idx,result in enumerate(px):
79
  results[labels[idx]] = px[idx][0]
80
  #results[labels['label']] = result['score']
81
- tmp_res={f'{uid}-1':results}
82
- fin_sum.append(tmp_res)
83
  return gr.HTML.update(html_out),results
84
  def aiornot2(image):
85
  labels = ["AI", "Real"]
@@ -104,8 +104,8 @@ def aiornot2(image):
104
  results = {}
105
  for idx,result in enumerate(px):
106
  results[labels[idx]] = px[idx][0]
107
- tmp_res={f'{uid}-2':results}
108
- fin_sum.append(tmp_res)
109
  return gr.HTML.update(html_out),results
110
  def aiornot3(image):
111
  labels = ["Real", "AI"]
@@ -194,7 +194,7 @@ def load_url(url):
194
 
195
  def tot_prob():
196
  try:
197
- fin_out = fin_sum[0][0]+fin_sum[1][0]+fin_sum[2][0]
198
  print (fin_out)
199
  except Exception as e:
200
  print (f'ERROR :: {e}')
 
52
  for idx,result in enumerate(px):
53
  results[labels[idx]] = px[idx][0]
54
  #results[labels['label']] = result['score']
55
+ #tmp_res={f'{uid}-0':results}
56
+ fin_sum.append(results)
57
  return gr.HTML.update(html_out),results
58
  def aiornot1(image):
59
  labels = ["Real", "AI"]
 
78
  for idx,result in enumerate(px):
79
  results[labels[idx]] = px[idx][0]
80
  #results[labels['label']] = result['score']
81
+ #tmp_res={f'{uid}-1':results}
82
+ fin_sum.append(results)
83
  return gr.HTML.update(html_out),results
84
  def aiornot2(image):
85
  labels = ["AI", "Real"]
 
104
  results = {}
105
  for idx,result in enumerate(px):
106
  results[labels[idx]] = px[idx][0]
107
+ #tmp_res={f'{uid}-2':results}
108
+ fin_sum.append(results)
109
  return gr.HTML.update(html_out),results
110
  def aiornot3(image):
111
  labels = ["Real", "AI"]
 
194
 
195
  def tot_prob():
196
  try:
197
+ fin_out = fin_sum[0]["Real"]+fin_sum[1]["Real"]+fin_sum[2]["Real"]
198
  print (fin_out)
199
  except Exception as e:
200
  print (f'ERROR :: {e}')