Spaces:
Sleeping
Sleeping
| """ | |
| Detector configuration - device settings, model paths, and thresholds. | |
| """ | |
| import torch | |
| import warnings | |
| warnings.filterwarnings("ignore") | |
| # Check for GPU availability | |
| DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu") | |
| print(f"Using device: {DEVICE}") | |
| if torch.cuda.is_available(): | |
| print(f"GPU: {torch.cuda.get_device_name(0)}") | |
| # Model configuration | |
| SIGLIP_MODEL_NAME = "shunda012/siglip-deepfake-detector" | |
| VIT_MODEL_NAME = "shunda012/vit-deepfake-detector" | |
| # Prediction threshold | |
| REAL_THRESHOLD = 0.90 # classify as real only when P(real) >= 90% | |