Skip to content

Commit 3fa2de8

Browse files
committed
initial commit
0 parents  commit 3fa2de8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+5443
-0
lines changed

.dockerignore

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Git files
2+
.git
3+
.gitignore
4+
.github
5+
6+
# Python cache
7+
__pycache__
8+
*.py[cod]
9+
*$py.class
10+
*.so
11+
.pytest_cache
12+
13+
# Virtual environments
14+
venv/
15+
ENV/
16+
env/
17+
.venv
18+
19+
# IDEs
20+
.vscode/
21+
.idea/
22+
*.swp
23+
*.swo
24+
*~
25+
26+
# Build artifacts
27+
build/
28+
dist/
29+
*.egg-info/
30+
31+
# Notebooks
32+
.ipynb_checkpoints
33+
34+
# Test outputs
35+
htmlcov/
36+
.coverage
37+
.tox/
38+
39+
# Training outputs
40+
output_*/
41+
wandb/
42+
logs/
43+
checkpoints/
44+
*.log
45+
46+
# Large files (weights should be downloaded in container)
47+
weights/
48+
videos/
49+
data/
50+
datasets/
51+
52+
# Temporary files
53+
tmp/
54+
temp/
55+
*.tmp
56+
57+
# macOS
58+
.DS_Store

.github/workflows/test.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Model Comparison Tests
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
workflow_dispatch:
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
python-version: ["3.11", "3.12"]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Cache pip packages
27+
uses: actions/cache@v3
28+
with:
29+
path: ~/.cache/pip
30+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
31+
restore-keys: |
32+
${{ runner.os }}-pip-
33+
34+
- name: Cache model weights
35+
uses: actions/cache@v3
36+
with:
37+
path: weights
38+
key: ${{ runner.os }}-model-weights-vitl-v1
39+
restore-keys: |
40+
${{ runner.os }}-model-weights-
41+
42+
- name: Cache MLX build
43+
uses: actions/cache@v3
44+
with:
45+
path: ../mlx
46+
key: ${{ runner.os }}-mlx-${{ hashFiles('**/requirements.txt') }}
47+
restore-keys: |
48+
${{ runner.os }}-mlx-
49+
50+
- name: Install system dependencies
51+
run: |
52+
sudo apt-get update
53+
sudo apt-get install -y cmake ninja-build libblas-dev liblapack-dev liblapacke-dev libopenblas-dev gfortran
54+
55+
- name: Build and install MLX from source
56+
run: |
57+
cd ..
58+
if [ ! -d "mlx" ]; then
59+
git clone https://github.com/ml-explore/mlx.git
60+
fi
61+
cd mlx
62+
pip install .
63+
cd ../vjepa2-mlx
64+
65+
- name: Install dependencies
66+
run: |
67+
python -m pip install --upgrade pip
68+
pip install -r requirements.txt
69+
pip install -r requirements-test.txt
70+
pip install -e .
71+
72+
- name: Clone and install vjepa2 repository
73+
run: |
74+
cd ..
75+
if [ ! -d "vjepa2" ]; then
76+
git clone https://github.com/facebookresearch/vjepa2.git
77+
fi
78+
cd vjepa2
79+
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
80+
pip install -e .
81+
82+
- name: Run tests
83+
run: |
84+
pytest tests/test_model_comparison.py -v -s --tb=short

.gitignore

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
23+
pip-wheel-metadata/
24+
share/python-wheels/
25+
*.egg-info/
26+
.installed.cfg
27+
*.egg
28+
MANIFEST
29+
30+
# PyInstaller
31+
*.manifest
32+
*.spec
33+
34+
# Unit test / coverage reports
35+
htmlcov/
36+
.tox/
37+
.nox/
38+
.coverage
39+
.coverage.*
40+
.cache
41+
nosetests.xml
42+
coverage.xml
43+
*.cover
44+
*.py,cover
45+
.hypothesis/
46+
.pytest_cache/
47+
48+
# Jupyter Notebook
49+
.ipynb_checkpoints
50+
*.ipynb_checkpoints/
51+
52+
# IPython
53+
profile_default/
54+
ipython_config.py
55+
56+
# pyenv
57+
.python-version
58+
59+
# Virtual environments
60+
venv/
61+
ENV/
62+
env/
63+
.venv
64+
65+
# IDEs
66+
.vscode/
67+
.idea/
68+
*.swp
69+
*.swo
70+
*~
71+
.DS_Store
72+
73+
# MLX specific
74+
*.safetensors
75+
*.npz
76+
77+
# Training outputs
78+
output_*/
79+
wandb/
80+
logs/
81+
checkpoints/
82+
*.log
83+
84+
# Data directories
85+
data/
86+
datasets/
87+
videos/
88+
weights/
89+
90+
# Temporary files
91+
tmp/
92+
temp/
93+
*.tmp

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Changelog
2+
3+
All notable changes to the V-JEPA 2 MLX project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [0.0.1] - 2025-11-12
11+
12+
### Added
13+
- Initial MLX implementation of V-JEPA 2 models
14+
- Vision Transformer (ViT) with 3D patch embedding for video input
15+
- Attentive classifier for video action recognition
16+
- SSv2 classifier training script with frozen encoder
17+
- Training configuration system with YAML support
18+
- Interactive Jupyter notebooks for demonstrations
19+
- Pretrained weight conversion utilities
20+
- Comprehensive documentation and installation guide
21+
- Support for gradient accumulation for memory efficiency
22+
- Weights & Biases integration for experiment tracking
23+
- Training scripts with sensible defaults
24+
25+
### Features
26+
- MLX-optimized models for Apple Silicon (M1/M2/M3)
27+
- Frozen encoder fine-tuning for efficient transfer learning
28+
- Something-Something-v2 action recognition training pipeline
29+
- Configurable training hyperparameters
30+
- Checkpoint saving and resuming
31+
- Learning rate scheduling with cosine decay and warmup
32+
- Top-1 and Top-5 accuracy metrics
33+
34+
### Documentation
35+
- README with quick start guide
36+
- Detailed installation instructions (INSTALL.md)
37+
- Training configuration examples
38+
- Notebook tutorials for model usage
39+
40+
[Unreleased]: https://github.com/facebookresearch/vjepa2-mlx/compare/v0.0.1...HEAD
41+
[0.0.1]: https://github.com/facebookresearch/vjepa2-mlx/releases/tag/v0.0.1

0 commit comments

Comments
 (0)