How chenhaoxing/demamba works
DeMamba is a research codebase for detecting AI-generated videos, with GenVideo as its benchmark. The intended workflow is to prepare video-derived data, load it for training or evaluation, and classify videos using DeMamba or alternative detectors. The README documents preprocessing and the detection framework; sampled code shows video frame extraction, evaluation behavior, and selected model internals. Training and data-loading connections are not fully evidenced in the excerpts, so those links are marked unverified.
Main entry points: train.py Model training · dataloader.py Video data loading · DeMamba.py DeMamba detector · util.py Evaluation metrics
Components 20
Data preparation
- Frame extraction
Preprocess/video2frame.py - Video compression
Preprocess/compress.py - CSV lists
Preprocess/folder2csv.py
Training and evaluation
- Video data loading
dataloader.py - Model training
train.py - Evaluation metrics
util.py
Video detectors
- DeMamba detector
models/DeMamba.py - Alternative detectors
models - TALL Swin
models/TALL.py - STIL detector
models/STIL.py - F3Net detector
models/F3Net.py - NPR detector
models/NPR.py
Model internals
- CLIP loading
models/clip/clip.py - CLIP network
models/clip/model.py - CLIP tokenizer
models/clip/simple_tokenizer.py - Mamba sequence blocks
models/mamba_base.py - Parallel scan
models/pscan.py
Other components
- Dataset user
- Source videos
- Video predictions
Connections 19
- Dataset user → Source videos: provides
README.md - Source videos → Frame extraction: extracts frames
Preprocess/video2frame.py - Dataset user → Video compression: prepares videos
- Dataset user → CSV lists: creates data lists
README.md - Frame extraction → Video data loading: supplies frames
- CSV lists → Video data loading: supplies lists
- Video data loading → Model training: feeds batches
- Model training → DeMamba detector: trains detector
- Model training → Alternative detectors: selects detector
- Model training → TALL Swin: selects detector
- Model training → STIL detector: selects detector
- Model training → F3Net detector: selects detector
- Model training → NPR detector: selects detector
- Evaluation metrics → Video predictions: reports predictions
util.py - Evaluation metrics → DeMamba detector: evaluates model
- DeMamba detector → Mamba sequence blocks: uses blocks
- CLIP loading → CLIP network: builds network
models/clip/clip.py - CLIP loading → CLIP tokenizer: uses tokenizer
models/clip/clip.py - Mamba sequence blocks → Parallel scan: imports scan
models/mamba_base.py