Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,11 +2,17 @@
|
|
| 2 |
import gradio as gr
|
| 3 |
import cv2
|
| 4 |
import numpy as np
|
| 5 |
-
from huggingface_hub import
|
|
|
|
| 6 |
import tempfile
|
| 7 |
|
| 8 |
# Load the Keras deepfake detector
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
# Parameters
|
| 12 |
NUM_FRAMES = 16 # frames to sample
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
import cv2
|
| 4 |
import numpy as np
|
| 5 |
+
from huggingface_hub import hf_hub_download
|
| 6 |
+
import tensorflow as tf
|
| 7 |
import tempfile
|
| 8 |
|
| 9 |
# Load the Keras deepfake detector
|
| 10 |
+
model_path = hf_hub_download(
|
| 11 |
+
repo_id="DaMsTaR/Detecto-DeepFake_Video_Detector",
|
| 12 |
+
filename="model.h5" # adjust if the repo has a different file
|
| 13 |
+
)
|
| 14 |
+
# Load Keras model
|
| 15 |
+
model = tf.keras.models.load_model(model_path)
|
| 16 |
|
| 17 |
# Parameters
|
| 18 |
NUM_FRAMES = 16 # frames to sample
|