Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,7 @@ pipe1 = pipeline("image-classification", f"{models[1]}")
|
|
21 |
pipe2 = pipeline("image-classification", f"{models[2]}")
|
22 |
|
23 |
def image_classifier0(image):
|
24 |
-
labels = ["
|
25 |
outputs = pipe0(image)
|
26 |
results = {}
|
27 |
result_test={}
|
@@ -30,9 +30,10 @@ def image_classifier0(image):
|
|
30 |
print (result_test)
|
31 |
for result in outputs:
|
32 |
results[result['label']] = result['score']
|
|
|
33 |
return results
|
34 |
def image_classifier1(image):
|
35 |
-
labels = ["
|
36 |
outputs = pipe1(image)
|
37 |
results = {}
|
38 |
result_test={}
|
@@ -41,9 +42,10 @@ def image_classifier1(image):
|
|
41 |
print (result_test)
|
42 |
for result in outputs:
|
43 |
results[result['label']] = result['score']
|
|
|
44 |
return results
|
45 |
def image_classifier2(image):
|
46 |
-
labels = ["
|
47 |
outputs = pipe2(image)
|
48 |
results = {}
|
49 |
result_test={}
|
@@ -52,6 +54,7 @@ def image_classifier2(image):
|
|
52 |
print (result_test)
|
53 |
for result in outputs:
|
54 |
results[result['label']] = result['score']
|
|
|
55 |
return results
|
56 |
|
57 |
def softmax(vector):
|
@@ -162,7 +165,7 @@ def tot_prob():
|
|
162 |
"AI":f"{fin_sub}"
|
163 |
}
|
164 |
#fin_sum.clear()
|
165 |
-
print (fin_out)
|
166 |
return out
|
167 |
except Exception as e:
|
168 |
pass
|
|
|
21 |
pipe2 = pipeline("image-classification", f"{models[2]}")
|
22 |
|
23 |
def image_classifier0(image):
|
24 |
+
labels = ["Real","AI"]
|
25 |
outputs = pipe0(image)
|
26 |
results = {}
|
27 |
result_test={}
|
|
|
30 |
print (result_test)
|
31 |
for result in outputs:
|
32 |
results[result['label']] = result['score']
|
33 |
+
print (results)
|
34 |
return results
|
35 |
def image_classifier1(image):
|
36 |
+
labels = ["Real","AI"]
|
37 |
outputs = pipe1(image)
|
38 |
results = {}
|
39 |
result_test={}
|
|
|
42 |
print (result_test)
|
43 |
for result in outputs:
|
44 |
results[result['label']] = result['score']
|
45 |
+
print (results)
|
46 |
return results
|
47 |
def image_classifier2(image):
|
48 |
+
labels = ["Real","AI"]
|
49 |
outputs = pipe2(image)
|
50 |
results = {}
|
51 |
result_test={}
|
|
|
54 |
print (result_test)
|
55 |
for result in outputs:
|
56 |
results[result['label']] = result['score']
|
57 |
+
print (results)
|
58 |
return results
|
59 |
|
60 |
def softmax(vector):
|
|
|
165 |
"AI":f"{fin_sub}"
|
166 |
}
|
167 |
#fin_sum.clear()
|
168 |
+
#print (fin_out)
|
169 |
return out
|
170 |
except Exception as e:
|
171 |
pass
|