Update app.py
Browse files
app.py
CHANGED
@@ -123,7 +123,7 @@ deepfake_video_model = Model(inputs=base_model_video.input, outputs=x)
|
|
123 |
|
124 |
# Function to Preprocess Image
|
125 |
def preprocess_image(image_path):
|
126 |
-
img = load_img(image_path, target_size=(
|
127 |
img = img_to_array(img)
|
128 |
img = np.expand_dims(img, axis=0)
|
129 |
img /= 255.0 # Normalize pixel values
|
@@ -148,9 +148,9 @@ if st.button("Check News"):
|
|
148 |
confidence = prediction[0]['score']
|
149 |
|
150 |
if label == "FAKE":
|
151 |
-
st.
|
152 |
else:
|
153 |
-
st.
|
154 |
|
155 |
# ---- Deepfake Image Detection Section ----
|
156 |
st.subheader("📸 Deepfake Image Detection")
|
|
|
123 |
|
124 |
# Function to Preprocess Image
|
125 |
def preprocess_image(image_path):
|
126 |
+
img = load_img(image_path, target_size=(100, 100)) # Xception expects 299x299
|
127 |
img = img_to_array(img)
|
128 |
img = np.expand_dims(img, axis=0)
|
129 |
img /= 255.0 # Normalize pixel values
|
|
|
148 |
confidence = prediction[0]['score']
|
149 |
|
150 |
if label == "FAKE":
|
151 |
+
st.success(f"✅ Result: This news is REAL. (Confidence: {confidence:.2f})")
|
152 |
else:
|
153 |
+
st.error(f"⚠️ Result: This news is FAKE. (Confidence: {confidence:.2f})")
|
154 |
|
155 |
# ---- Deepfake Image Detection Section ----
|
156 |
st.subheader("📸 Deepfake Image Detection")
|