asad231 commited on
Commit
ab79ce6
ยท
verified ยท
1 Parent(s): c56f4ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -89,6 +89,7 @@ import numpy as np
89
  import cv2
90
  import tempfile
91
  import requests
 
92
  from pytube import YouTube
93
  import os
94
  from PIL import Image
@@ -298,11 +299,6 @@ if st.button("Check News"):
298
  else:
299
  st.success(f"โœ… Result: This news is **REAL**. (Confidence: {confidence:.2f})")
300
 
301
- # ---- Deepfake Image Detection Section ----
302
- import streamlit as st
303
- import tempfile
304
- from PIL import Image
305
-
306
  st.subheader("๐Ÿ“ธ Deepfake Image Detection")
307
  uploaded_image = st.file_uploader("Upload an Image", type=["jpg", "png", "jpeg"])
308
 
@@ -311,8 +307,8 @@ if uploaded_image is not None:
311
  img = Image.open(uploaded_image).convert("RGB")
312
  img.save(temp_file.name, "JPEG")
313
 
314
- # ๐Ÿ› ๏ธ FIX: use_container_width=True instead of use_column_width=True
315
- st.image(temp_file.name, caption="๐Ÿ–ผ๏ธ Uploaded Image", use_container_width=True)
316
 
317
  if st.button("Analyze Image"):
318
  st.write("๐Ÿ” Processing...")
 
89
  import cv2
90
  import tempfile
91
  import requests
92
+ from PIL import Image
93
  from pytube import YouTube
94
  import os
95
  from PIL import Image
 
299
  else:
300
  st.success(f"โœ… Result: This news is **REAL**. (Confidence: {confidence:.2f})")
301
 
 
 
 
 
 
302
  st.subheader("๐Ÿ“ธ Deepfake Image Detection")
303
  uploaded_image = st.file_uploader("Upload an Image", type=["jpg", "png", "jpeg"])
304
 
 
307
  img = Image.open(uploaded_image).convert("RGB")
308
  img.save(temp_file.name, "JPEG")
309
 
310
+ # ๐Ÿ› ๏ธ FIX: Set image width (e.g., 300 pixels)
311
+ st.image(temp_file.name, caption="๐Ÿ–ผ๏ธ Uploaded Image", width=300)
312
 
313
  if st.button("Analyze Image"):
314
  st.write("๐Ÿ” Processing...")