Update app.py
Browse files
app.py
CHANGED
@@ -15,9 +15,20 @@ from unsloth import FastVisionModel
|
|
15 |
import os
|
16 |
import tempfile
|
17 |
import warnings
|
18 |
-
from gradcam_xception import load_xception_model, generate_smoothgrad_visualizations_xception
|
19 |
warnings.filterwarnings("ignore", category=UserWarning)
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
# App title and description
|
22 |
st.set_page_config(
|
23 |
page_title="Deepfake Analyzer",
|
|
|
15 |
import os
|
16 |
import tempfile
|
17 |
import warnings
|
18 |
+
from gradcam_xception import load_xception_model, generate_smoothgrad_visualizations_xception
|
19 |
warnings.filterwarnings("ignore", category=UserWarning)
|
20 |
|
21 |
+
# Define Xception transform function directly in app.py
|
22 |
+
def get_xception_transform():
|
23 |
+
"""Get the image transformation pipeline for Xception input."""
|
24 |
+
# Standard Xception preprocessing
|
25 |
+
transform = transforms.Compose([
|
26 |
+
transforms.Resize((299, 299)),
|
27 |
+
transforms.ToTensor(),
|
28 |
+
transforms.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5]),
|
29 |
+
])
|
30 |
+
return transform
|
31 |
+
|
32 |
# App title and description
|
33 |
st.set_page_config(
|
34 |
page_title="Deepfake Analyzer",
|