This example trains a Xception model on the AVDeepfake1M/AVDeepfake1M++ dataset for classification with video-level labels.
- Python
- PyTorch
- PyTorch Lightning
- TIMM
- AVDeepfake1M SDK
python train.py --data_root /path/to/avdeepfake1m --model xception- Checkpoints: Model checkpoints are saved under
./ckpt/xception/. The last checkpoint is saved aslast.ckpt. - Logs: Training logs (including metrics like
train_loss,val_loss, and learning rates) are saved by PyTorch Lightning, typically in a directory named./lightning_logs/. You can view these logs using TensorBoard (tensorboard --logdir ./lightning_logs).
After training, you can generate predictions on a dataset subset (train, val, or test) using infer.py. This script will save the predictions to a text file, following the format from the challenge.
python infer.py --data_root /path/to/avdeepfake1m --checkpoint /path/to/your/checkpoint.ckpt --model xception --subset valThe output prediction file will be saved to output/<model_name>_<subset>.txt (e.g., output/xception_val.txt).
python evaluate.py <path_to_prediction_file> <path_to_metadata_json>For example:
python evaluate.py ./output/xception_val.txt /path/to/avdeepfake1m/val_metadata.jsonThis will print the AUC score based on your model's predictions.