Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
90 lines (68 loc) · 2.86 KB
/
Copy pathMakefile
File metadata and controls
90 lines (68 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
.PHONY: install setup-accelerate clean data train inference evaluate all test-imports test-data test-train test-all validate-data test-unit
# ============================================
# INSTALLATION
# ============================================
# Full installation
install:
pip install -r requirements.txt
pip install -e .
# Setup accelerate (run once before training)
setup-accelerate:
accelerate config --config_file configs/accelerate_config.yaml
# Test that all imports work
test-imports:
python -c "from src.model import VideoDPOModelWrapper; from src.trainer import DPOTrainer; from src.dataset import VideoDPODataset; print('All imports successful!')"
# ============================================
# FULL PIPELINE (Production)
# ============================================
# Phase 1: Data Gen (Expect ~3 hours on A100)
data:
python scripts/generate_data.py --config configs/train_config.yaml
# Phase 2: Training (Expect ~12 hours)
train:
accelerate launch --config_file configs/accelerate_config.yaml scripts/train.py --config configs/train_config.yaml
# Alternative: Train without accelerate config (auto-detect)
train-auto:
accelerate launch scripts/train.py --config configs/train_config.yaml
# Phase 3: Validation (Side-by-side GIF comparison)
inference:
python scripts/inference.py --config configs/train_config.yaml --checkpoint checkpoints/latest
# Phase 4: Quantitative Evaluation (Warping Error Metric)
evaluate:
python scripts/evaluate.py --config configs/train_config.yaml --checkpoint checkpoints/latest --num_samples 20
# Run full pipeline
all: data train inference evaluate
# Fast unit tests that avoid model downloads
test-unit:
python -m unittest discover -s tests -p 'test_*.py'
# Validate generated data
validate-data:
python scripts/validate_data.py --config configs/train_config.yaml
# ============================================
# TESTING (Quick validation with minimal data)
# ============================================
# Generate test data (5 pairs only)
test-data:
python scripts/generate_data.py --config configs/test_config.yaml
# Validate test data
test-validate:
python scripts/validate_data.py --config configs/test_config.yaml
# Run test training (20 steps)
test-train:
accelerate launch scripts/train.py --config configs/test_config.yaml
# Run test inference
test-inference:
python scripts/inference.py --config configs/test_config.yaml --checkpoint checkpoints_test/latest
# Full test pipeline
test-all: test-data test-validate test-train test-inference
@echo "Test pipeline completed successfully!"
# ============================================
# CLEANUP
# ============================================
# Clean all generated files
clean:
find . -type d -name "__pycache__" -exec rm -rf {} +
rm -rf logs/ checkpoints/ data/ evaluation_results/
# Clean test files only
clean-test:
rm -rf logs_test/ checkpoints_test/ data/latents_test/