Instructions to use ChristianDW15/deepfake-deit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ChristianDW15/deepfake-deit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="ChristianDW15/deepfake-deit") pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoImageProcessor, AutoModelForImageClassification processor = AutoImageProcessor.from_pretrained("ChristianDW15/deepfake-deit") model = AutoModelForImageClassification.from_pretrained("ChristianDW15/deepfake-deit", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Deepfake Detection DeiT (Stage 3, DCT 4-channel)
Model DeiT untuk deteksi citra deepfake. Versi ini adalah Stage 3 DCT:
patch embedding dimodifikasi Conv2d(3โ4) dengan channel ke-4 = fitur DCT
(frekuensi). Bukan model RGB standar โ input harus 4-channel (RGB + DCT).
Label
0 = FAKE, 1 = REAL (ImageFolder alfabetis: Fake/ < Real/).
Threshold
Gunakan 0.45177 (Youden's J) pada P(Real) โ bukan 0.5.
Klasifikasi REAL bila P(Real) >= 0.45177, selain itu FAKE.
Cara load (custom, BUKAN from_pretrained)
from_pretrained() standar tidak cocok karena patch embed 4-channel.
Load via kode kustom: bangun arsitektur DCT (patch embed 3โ4) lalu
load_state_dict(safetensors.torch.load_file("model.safetensors")).
Preprocessing wajib menambah channel DCT (cv2.dct โ log1p(abs) โ minmax)
identik dengan pipeline training. Widget inferensi HF dinonaktifkan
(inference: false) karena butuh preprocessing 4-channel kustom.
- Downloads last month
- 21