Update app.py
Browse files
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:
|
315 |
-
st.image(temp_file.name, caption="๐ผ๏ธ Uploaded Image",
|
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...")
|