Spaces:
Running
on
Zero
Running
on
Zero
Update deepfake_vs_real.py
Browse files- deepfake_vs_real.py +2 -0
deepfake_vs_real.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
from transformers import AutoImageProcessor
|
3 |
from transformers import SiglipForImageClassification
|
4 |
from transformers.image_utils import load_image
|
@@ -10,6 +11,7 @@ model_name = "prithivMLmods/Deepfake-vs-Real-8000"
|
|
10 |
model = SiglipForImageClassification.from_pretrained(model_name)
|
11 |
processor = AutoImageProcessor.from_pretrained(model_name)
|
12 |
|
|
|
13 |
def deepfake_classification(image):
|
14 |
"""Predicts whether an image is a Deepfake or Real."""
|
15 |
image = Image.fromarray(image).convert("RGB")
|
|
|
1 |
import gradio as gr
|
2 |
+
import spaces
|
3 |
from transformers import AutoImageProcessor
|
4 |
from transformers import SiglipForImageClassification
|
5 |
from transformers.image_utils import load_image
|
|
|
11 |
model = SiglipForImageClassification.from_pretrained(model_name)
|
12 |
processor = AutoImageProcessor.from_pretrained(model_name)
|
13 |
|
14 |
+
@spaces.GPU
|
15 |
def deepfake_classification(image):
|
16 |
"""Predicts whether an image is a Deepfake or Real."""
|
17 |
image = Image.fromarray(image).convert("RGB")
|