Upload folder using huggingface_hub
Browse files13 unmodified lines14151617181920212223242526272825 unmodified lines545556575859606113 unmodified lines- f1pipeline_tag: image-classificationinference: falsewidgets:- text: "Test the DeepGuard Model Live"src: "https://harshasnade-deepfake-detection-system-v1.hf.space"- text: "Deepfake Sample"src: "https://harshasnade-deepfake-detection-system-v1.hf.space"---# DeepGuard - Deepfake Detection System## Model Details### Model Description25 unmodified lines- **Video Analysis:** While it can analyze individual frames, it does not currently leverage temporal coherence in videos (frame-by-frame analysis only).- **Audio Deepfakes:** This model is strictly for visual content.- **Legal Proof:** The model provides a probabilistic assessment and should not be the sole basis for legal judgments.## Training Details13 unmodified lines14151617181920212223242525 unmodified lines515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969713 unmodified lines- f1pipeline_tag: image-classificationinference: false---# DeepGuard - Deepfake Detection System[](https://huggingface.co/spaces/Harshasnade/Deepfake_Detection_System_V1)## Model Details### Model Description25 unmodified lines- **Video Analysis:** While it can analyze individual frames, it does not currently leverage temporal coherence in videos (frame-by-frame analysis only).- **Audio Deepfakes:** This model is strictly for visual content.- **Legal Proof:** The model provides a probabilistic assessment and should not be the sole basis for legal judgments.## How to Get Started with the Model```pythonimport torchimport torch.nn as nnfrom torchvision import modelsfrom safetensors.torch import load_fileimport cv2# Define Model Architectureclass DeepfakeDetector(nn.Module):def __init__(self, pretrained=False):super(DeepfakeDetector, self).__init__()self.efficientnet = models.efficientnet_v2_s(weights='DEFAULT' if pretrained else None)self.swin = models.swin_v2_t(weights='DEFAULT' if pretrained else None)self.efficientnet.classifier = nn.Identity()self.swin.head = nn.Identity()self.classifier = nn.Sequential(nn.Linear(1280 + 768, 512),nn.BatchNorm1d(512),nn.ReLU(),nn.Dropout(0.4),nn.Linear(512, 1))def forward(self, x):f1 = self.efficientnet(x)f2 = self.swin(x)combined = torch.cat((f1, f2), dim=1)return self.classifier(combined)# Load Modeldevice = torch.device("cuda" if torch.cuda.is_available() else "cpu")model = DeepfakeDetector(pretrained=False).to(device)state_dict = load_file("best_model.safetensors")model.load_state_dict(state_dict)model.eval()```## Training Details
README.md+43-7