YAML Metadata
Warning:
empty or missing yaml metadata in repo card
(https://huggingface.co/docs/hub/model-cards#model-card-metadata)
AIGVDet
An official implementation code for paper "AI-Generated Video Detection via Spatial-Temporal Anomaly Learning", PRCV 2024. This repo will provide codes, trained weights, and our training datasets.
Network Architecture
Dataset
- Download the preprocessed training frames from Baiduyun Link (extract code: ra95).
- Download the test videos from Google Drive.
You are allowed to use the datasets for research purpose only.
Training
- Prepare for the training datasets.
ββdata
βββ train
β βββ trainset_1
β βββ 0_real
β β βββ video_00000
β β β βββ 00000.png
β β β βββ ...
β β βββ ...
β βββ 1_fake
β βββ video_00000
β β βββ 00000.png
β β βββ ...
β βββ ...
βββ val
β βββ val_set_1
β βββ 0_real
β β βββ video_00000
β β β βββ 00000.png
β β β βββ ...
β β βββ ...
β βββ 1_fake
β βββ video_00000
β β βββ 00000.png
β β βββ ...
β βββ ...
βββ test
βββ testset_1
βββ 0_real
β βββ video_00000
β β βββ 00000.png
β β βββ ...
β βββ ...
βββ 1_fake
βββ video_00000
β βββ 00000.png
β βββ ...
βββ ...
- Modify configuration file in
core/utils1/config.py. - Train the Spatial Domain Detector with the RGB frames.
python train.py --gpus 0 --exp_name TRAIN_RGB_BRANCH datasets RGB_TRAINSET datasets_test RGB_TESTSET
- Train the Optical Flow Detector with the optical flow frames.
python train.py --gpus 0 --exp_name TRAIN_OF_BRANCH datasets OpticalFlow_TRAINSET datasets_test OpticalFlow_TESTSET
Testing
Download the weights from Google Drive Link and move it into the checkpoints/.
- Run on a dataset. Prepare the RGB frames and the optical flow maps.
python test.py -fop "data/test/hotshot" -mop "checkpoints/optical_aug.pth" -for "data/test/original/hotshot" -mor "checkpoints/original_aug.pth" -e "data/results/T2V/hotshot.csv" -ef "data/results/frame/T2V/hotshot.csv" -t 0.5
- Run on a video.
Download the RAFT model weights from Google Drive Link and move it into the
raft_model/.
python demo.py --use_cpu --path "video/000000.mp4" --folder_original_path "frame/000000" --folder_optical_flow_path "optical_result/000000" -mop "checkpoints/optical.pth" -mor "checkpoints/original.pth"
License
The code and dataset is released only for academic research. Commercial usage is strictly prohibited.
Citation
@article{AIGVDet24,
author = {Jianfa Bai and Man Lin and Gang Cao and Zijie Lou},
title = {{AI-generated video detection via spatial-temporal anomaly learning}},
conference = {The 7th Chinese Conference on Pattern Recognition and Computer Vision (PRCV)},
year = {2024},}
Contact
If you have any questions, please contact us(lyan924@cuc.edu.cn).
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
π
Ask for provider support