Update app.py
Browse files
app.py
CHANGED
@@ -438,16 +438,19 @@ elif video_url:
|
|
438 |
st.video(video_url) # Show the video directly from URL
|
439 |
video_path = download_video(video_url) # Download the video for analysis
|
440 |
|
441 |
-
#
|
442 |
-
if video_path and
|
443 |
-
st.
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
|
|
|
|
|
|
452 |
|
453 |
st.markdown("🔹 **Developed for Fake News & Deepfake Detection Hackathon**")
|
|
|
438 |
st.video(video_url) # Show the video directly from URL
|
439 |
video_path = download_video(video_url) # Download the video for analysis
|
440 |
|
441 |
+
# Ensure video_path is valid before analysis
|
442 |
+
if video_path and os.path.exists(video_path):
|
443 |
+
if st.button("Analyze Video"):
|
444 |
+
st.write("🔍 Processing... Please wait.")
|
445 |
+
result = detect_deepfake_video(video_path)
|
446 |
+
|
447 |
+
if result["label"] == "FAKE":
|
448 |
+
st.error(f"⚠️ Deepfake Detected! This video appears to be FAKE. (Confidence: {result['score']:.2f})")
|
449 |
+
elif result["label"] == "REAL":
|
450 |
+
st.success(f"✅ This video appears to be REAL. (Confidence: {1 - result['score']:.2f})")
|
451 |
+
else:
|
452 |
+
st.warning("⚠️ Unable to analyze the video. Please try a different file.")
|
453 |
+
else:
|
454 |
+
st.warning("⚠️ Please upload a video or enter a valid URL.")
|
455 |
|
456 |
st.markdown("🔹 **Developed for Fake News & Deepfake Detection Hackathon**")
|