Spaces:
Runtime error
Runtime error
Tirath5504
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -24,7 +24,9 @@ def predict(image):
|
|
24 |
|
25 |
label , confidence = imgResult[0]['label'] , float(imgResult[1]['label'])
|
26 |
|
27 |
-
if confidence > 0.
|
|
|
|
|
28 |
return ["hate" , f"label: {label}, confidence: {confidence}"]
|
29 |
else:
|
30 |
|
|
|
24 |
|
25 |
label , confidence = imgResult[0]['label'] , float(imgResult[1]['label'])
|
26 |
|
27 |
+
if label == 'finger_gun_to_the_head' and confidence > 0.98:
|
28 |
+
return ["hate" , f"label: {label}, confidence: {confidence}"]
|
29 |
+
elif label != 'finger_gun_to_the_head' and confidence > 0.95:
|
30 |
return ["hate" , f"label: {label}, confidence: {confidence}"]
|
31 |
else:
|
32 |
|