A complete end-to-end platform for creating and animating 3D Gaussian avatars from video, with real-time WebGPU rendering.
The platform consists of 3 critical layers:
-
π΄ RECONSTRUCTION LAYER (SplattingAvatar + gsplat) Converts real-world video β 3D Gaussian Avatar
-
π΅ ANIMATION LAYER (GaussianSpeech) Converts audio β Gaussian deformations
-
π’ RUNTIME LAYER (WebGPU Renderer) Real-time Gaussian splatting in browser
avatar-platform/
βββ backend/ # FastAPI server
β βββ app/
β β βββ api/ # REST endpoints
β β βββ services/ # Queue, storage, RunPod client
β β βββ models/ # Data models
β
βββ worker/ # RunPod GPU workers
β βββ reconstruction/ # COLMAP + SplattingAvatar + gsplat
β βββ animation/ # GaussianSpeech
β
βββ frontend/ # React + WebGPU renderer
β βββ src/
β βββ engine/ # WebGPU rendering engine
β βββ pages/ # UI components
β
βββ docker/ # Docker configurations
βββ scripts/ # Setup scripts
- Docker & Docker Compose
- RunPod account (for GPU processing)
- Node.js 18+ (for frontend development)
- Python 3.10+ (for local development)
cd /Users/marcelo/Documents/avatar-platform
cp .env.example .env
# Edit .env with your RunPod credentialsdocker-compose up -dThis starts:
- Backend API on
http://localhost:8000 - Frontend on
http://localhost:3000 - Redis on
localhost:6379 - MinIO on
http://localhost:9000
chmod +x scripts/setup_runpod.sh
./scripts/setup_runpod.shkill
cd /Users/mac/Documents/avatar-platform npm run dev
cd backend
pip install -r requirements.txt
uvicorn app.main:app --reloadcd frontend
npm install
npm run devcd worker
python runpod_worker.pyPOST /api/v1/avatar/create
{
"video_url": "https://...",
"mode": "head"
}POST /api/v1/avatar/upload
Content-Type: multipart/form-dataPOST /api/v1/animate
{
"avatar_id": "avatar_123",
"audio_url": "https://..."
}WebSocket: ws://localhost:8000/api/v1/stream/{avatar_id}- Python 3.10+
- FastAPI
- Redis (job queue)
- S3/MinIO (storage)
- PyTorch 2.x
- CUDA 11.8+
- COLMAP (pose estimation)
- gsplat (Gaussian splatting)
- SplattingAvatar
- GaussianSpeech
- React + TypeScript
- Vite
- WebGPU API (with WebGL2 fallback)
β Upload video β Generate Gaussian avatar β Render in browser (WebGPU) β Animate with audio
Video file (MP4)
- Extract frames (ffmpeg)
- COLMAP pose estimation
- SplattingAvatar preprocessing
- gsplat training (30k iterations)
- Export
.plyfile
gaussians.ply- Gaussian parametersmetadata.json- Model info
- Avatar ID
- Audio file (WAV)
- Load avatar gaussians
- Extract audio features
- GaussianSpeech inference
- Generate deformation sequence
WebSocket stream of deformations
Located in: frontend/src/engine/webgpu_renderer.ts
Pipeline:
- Load Gaussian splats from
.ply - Upload to GPU buffers
- Compute passes:
- Frustum culling
- Projection to screen space
- GPU radix sort (depth sorting)
- Render pass:
- Splat each Gaussian as billboard quad
- Gaussian falloff in fragment shader
Render Loop:
requestAnimationFrame(() => {
updateCamera()
updateDeformations() // From animation stream
runComputePasses()
renderFrame()
}){
"id": "avatar_123",
"gaussians_url": "https://...",
"rig": {},
"type": "head",
"created_at": "2024-01-01T00:00:00Z"
}{
"id": "anim_123",
"avatar_id": "avatar_123",
"stream_url": "wss://..."
}{
"timestamp": 0.033,
"positions": [...], // Float32Array
"rotations": [...] // Float32Array (quaternions)
}The worker code contains scaffolding for:
-
SplattingAvatar Paper: SplattingAvatar: Realistic Real-Time Human Avatars with Mesh-Embedded Gaussian Splatting
- Needs actual implementation of FLAME fitting
- Head segmentation
- Canonical space mapping
-
GaussianSpeech
- Audio-driven facial animation
- Requires audio feature extraction (HuBERT/Wav2Vec)
- Motion prediction network
-
gsplat Uses: nerfstudio-project/gsplat
- Already has PyPI package
- May need custom training loop
- Check support:
navigator.gpu - Fallback to WebGL2 if unavailable
- Current implementation is simplified for MVP
- Full sorting pipeline needs GPU radix sort implementation
- GPU radix sort for depth ordering
- Hierarchical culling
- LOD system
- Streaming compression
- Batch processing
docker build -f docker/worker.Dockerfile -t avatar-worker .docker build -f docker/backend.Dockerfile -t avatar-backend .docker-compose -f docker-compose.prod.yml up -dSee .env.example for all configuration options.
Required for RunPod:
RUNPOD_API_KEY- Your RunPod API keyRUNPOD_ENDPOINT_ID- Deployed endpoint ID
- Check Redis connection:
redis-cli ping - Check MinIO:
curl http://localhost:9000/minio/health/live
- Check CUDA availability:
nvidia-smi - Verify COLMAP installation:
colmap -h
- Check browser support: Chrome 113+, Edge 113+
- Enable flag:
chrome://flags/#enable-unsafe-webgpu
- Check WebSocket connection in browser console
- Verify Redis queue is processing jobs
- No user authentication
- No database (using Redis only)
- Simplified WebGPU shaders
- No production optimization
- Limited error handling
- No testing suite
- Implement full SplattingAvatar pipeline
- Integrate real GaussianSpeech model
- Optimize WebGPU renderer (full sorting)
- Add user management
- Implement database (PostgreSQL)
- Add monitoring & logging
- Performance profiling
- Production deployment setup
MIT
Built with Claude Code π€