asad231 commited on
Commit
a9e5221
·
verified ·
1 Parent(s): 8e3c507

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -456,9 +456,12 @@ elif video_url:
456
  st.video(video_url) # Show direct MP4 video
457
  video_path = download_video(video_url) # Download direct MP4 video
458
 
459
- # Ensure video_path is valid before analysis
460
- if video_path and os.path.exists(video_path):
461
- if st.button("Analyze Video"):
 
 
 
462
  st.write("🔍 Processing... Please wait.")
463
  result = detect_deepfake_video(video_path)
464
 
@@ -468,7 +471,7 @@ if video_path and os.path.exists(video_path):
468
  st.success(f"✅ This video appears to be REAL. (Confidence: {1 - result['score']:.2f})")
469
  else:
470
  st.warning("⚠️ Unable to analyze the video. Please try a different file.")
471
- else:
472
- st.warning("⚠️ Please upload a video or enter a valid URL.")
473
 
474
  st.markdown("🔹 **Developed for Fake News & Deepfake Detection Hackathon**")
 
456
  st.video(video_url) # Show direct MP4 video
457
  video_path = download_video(video_url) # Download direct MP4 video
458
 
459
+ # "Analyze Video" بٹن ہمیشہ شو ہوگا
460
+ analyze_button = st.button("Analyze Video")
461
+
462
+ # 🚀 اگر ویڈیو موجود ہے تو تجزیہ کریں
463
+ if analyze_button:
464
+ if video_path and os.path.exists(video_path):
465
  st.write("🔍 Processing... Please wait.")
466
  result = detect_deepfake_video(video_path)
467
 
 
471
  st.success(f"✅ This video appears to be REAL. (Confidence: {1 - result['score']:.2f})")
472
  else:
473
  st.warning("⚠️ Unable to analyze the video. Please try a different file.")
474
+ else:
475
+ st.warning("⚠️ Invalid video. Please check the file or URL.")
476
 
477
  st.markdown("🔹 **Developed for Fake News & Deepfake Detection Hackathon**")