| import os | |
| from pathlib import Path | |
| import torch | |
| # Model configuration - For Hugging Face, model is in the same directory | |
| MODEL_PATH = Path(__file__).parent / "ffpp_efficientnet_best.pth" | |
| # Device configuration | |
| if torch.cuda.is_available(): | |
| DEVICE = "cuda" | |
| elif torch.backends.mps.is_available(): | |
| DEVICE = "mps" | |
| else: | |
| DEVICE = "cpu" | |
| # Prediction threshold (0.5 works well based on your notebook testing) | |
| PREDICTION_THRESHOLD = float(os.environ.get("PREDICTION_THRESHOLD", 0.5)) | |
| # Video processing | |
| FRAMES_PER_CLIP = 16 | |
| IMG_SIZE = 224 | |
| # ImageNet normalization (same as training) | |
| IMAGENET_MEAN = [0.485, 0.456, 0.406] | |
| IMAGENET_STD = [0.229, 0.224, 0.225] | |
| # Logging | |
| LOG_LEVEL = os.environ.get("LOG_LEVEL", "INFO") |