Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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(
|
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(
|
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(
|
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][
|
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}')
|