A high-performance port of Sharp (3D Gaussian Splatting from a single image) to MLX, available in Python and Swift.
Running entirely on Apple Silicon and achieves faster inference speeds compared to the PyTorch original.
- Download the official PyTorch checkpoint:
mkdir -p checkpoints
wget https://ml-site.cdn-apple.com/models/sharp/sharp_2572gikvuh.pt -O checkpoints/sharp.pt- Convert to MLX format:
cd python
# This generates checkpoints/sharp.safetensors
python convert.py -i ../checkpoints/sharp.pt -o ../checkpoints/sharp.safetensorscd python
# Install dependencies
pip install -r requirements.txt
# Run inference
python generate.py --input ../inputs/image.jpg --output ../output.ply --checkpoint ../checkpoints/sharp.safetensorscd swift
# Build
xcodebuild build -scheme generate -configuration Release -destination 'platform=macOS' -derivedDataPath .build/DerivedData -quiet
# Run inference
.build/DerivedData/Build/Products/Release/generate --input ../inputs/image.jpg --output ../output.ply --weights ../checkpoints/sharp.safetensorsNote: Video rendering uses gsplat-mps which is AGPL-3.0 licensed. See the
renderbranch for this feature.
# On the render branch
python generate.py --input image.jpg --output output.ply --checkpoint sharp.safetensors --render --trajectory rotate_forward --num-frames 60Trajectory options: swipe, shake, rotate, rotate_forward
python/- Pure MLX Python implementationswift/- Pure MLX Swift implementationcheckpoints/- Model weights
This project is licensed under the Apache License 2.0.
Based on Apple's Sharp (Copyright (C) 2025 Apple Inc.)
