Update app.py
Browse files
app.py
CHANGED
@@ -184,14 +184,11 @@ if st.button("Check News"):
|
|
184 |
label = prediction[0]['label'].lower()
|
185 |
confidence = prediction[0]['score']
|
186 |
|
187 |
-
#
|
188 |
-
if label == "fake" or confidence
|
189 |
st.error(f"⚠️ Result: This news is **FAKE**. (Confidence: {confidence:.2f})")
|
190 |
-
elif label == "real" and confidence > 0.6:
|
191 |
-
st.success(f"✅ Result: This news is **REAL**. (Confidence: {confidence:.2f})")
|
192 |
else:
|
193 |
-
st.
|
194 |
-
|
195 |
# ---- Deepfake Image Detection Section ----
|
196 |
st.subheader("📸 Deepfake Image Detection")
|
197 |
uploaded_image = st.file_uploader("Upload an Image", type=["jpg", "png", "jpeg"])
|
|
|
184 |
label = prediction[0]['label'].lower()
|
185 |
confidence = prediction[0]['score']
|
186 |
|
187 |
+
# Ensure classification even for low confidence cases
|
188 |
+
if label == "fake" or confidence >= 0.5:
|
189 |
st.error(f"⚠️ Result: This news is **FAKE**. (Confidence: {confidence:.2f})")
|
|
|
|
|
190 |
else:
|
191 |
+
st.success(f"✅ Result: This news is **REAL**. (Confidence: {confidence:.2f})")
|
|
|
192 |
# ---- Deepfake Image Detection Section ----
|
193 |
st.subheader("📸 Deepfake Image Detection")
|
194 |
uploaded_image = st.file_uploader("Upload an Image", type=["jpg", "png", "jpeg"])
|