Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,7 +31,7 @@ def crop_face(pil_img, pad=0.25):
|
|
| 31 |
return face if face.size[0] > 20 and face.size[1] > 20 else pil_img
|
| 32 |
|
| 33 |
def face_oval_mask(img_pil, shrink=0.80):
|
| 34 |
-
|
| 35 |
w, h = img_pil.size
|
| 36 |
mask = Image.new("L", (w, h), 0)
|
| 37 |
draw = ImageDraw.Draw(mask)
|
|
@@ -42,7 +42,7 @@ def face_oval_mask(img_pil, shrink=0.80):
|
|
| 42 |
# -------------------- HF model: Deepfake vs Realism --------------------
|
| 43 |
MODEL_ID = "prithivMLmods/Deep-Fake-Detector-v2-Model"
|
| 44 |
|
| 45 |
-
# CPU by default
|
| 46 |
_hf_processor = AutoImageProcessor.from_pretrained(MODEL_ID)
|
| 47 |
_hf_model = ViTForImageClassification.from_pretrained(MODEL_ID)
|
| 48 |
_hf_model.eval()
|
|
|
|
| 31 |
return face if face.size[0] > 20 and face.size[1] > 20 else pil_img
|
| 32 |
|
| 33 |
def face_oval_mask(img_pil, shrink=0.80):
|
| 34 |
+
|
| 35 |
w, h = img_pil.size
|
| 36 |
mask = Image.new("L", (w, h), 0)
|
| 37 |
draw = ImageDraw.Draw(mask)
|
|
|
|
| 42 |
# -------------------- HF model: Deepfake vs Realism --------------------
|
| 43 |
MODEL_ID = "prithivMLmods/Deep-Fake-Detector-v2-Model"
|
| 44 |
|
| 45 |
+
# CPU by default
|
| 46 |
_hf_processor = AutoImageProcessor.from_pretrained(MODEL_ID)
|
| 47 |
_hf_model = ViTForImageClassification.from_pretrained(MODEL_ID)
|
| 48 |
_hf_model.eval()
|