Back to Projects
Flagship case studyreview surface

BodyFX

AI-powered video segmentation using Meta's SAM2 for automated rotoscoping in After Effects. BodyFX automatically detects and tracks subjects frame-by-frame, exporting segmentation data as animatable shape layers via 7 ExtendScript (.jsx) files.

Computer VisionVideo EffectsPythonSAM2After EffectsExtendScript
BodyFX

Build surface

The implementation surface for this system. These are the layers that mattered in practice, not a generic skills wall.
Core ML
SAM2 (Segment Anything Model 2), PyTorch
Video Processing
OpenCV, NumPy
Languages
Python 3.8+, ExtendScript (JSX)
Integration
Adobe After Effects API
Performance
CUDA GPU Acceleration, Batch Processing
Distribution
CLI Tools, pip installable

Project Overview

BodyFX bridges the gap between recent AI research and practical video production needs. By leveraging Meta's Segment Anything Model 2 (SAM2), it automates one of the most time-consuming tasks in visual effects: rotoscoping and subject isolation.

The Problem It Solves

Manual rotoscoping in video production is extremely time-intensive, often requiring hours of frame-by-frame work. BodyFX automates this process using SAM2-based AI segmentation, significantly reducing the time required while maintaining professional quality.

Use Cases

  • • Visual effects and compositing
  • • Motion graphics integration
  • • Subject isolation for color grading
  • • Background replacement in post-production
  • • Virtual production workflows

Key Benefits

  • • Significantly faster than manual rotoscoping
  • • Frame-accurate tracking via SAM2
  • • No training data required
  • • Works with any video content
  • • Professional After Effects integration (7 .jsx files)

Core Features

01

AI-Powered Video Segmentation

Leverage Meta's SAM2 model for automatic subject detection and tracking without manual rotoscoping setup

  • Automatic subject detection without manual rotoscoping
  • Frame-by-frame tracking with temporal consistency
  • Support for multiple model sizes (small, medium, large)
  • Custom prompt support for precise targeting
02

After Effects Integration

Seamless workflow integration with Adobe After Effects for professional VFX work

  • Direct import as animatable shape layers
  • Preserves frame-accurate timing and motion
  • Customizable stroke and fill styles
  • Automatic composition setup with proper dimensions
03

OBS Studio Plugin (Planned)

Early-stage exploration of real-time background removal for live streaming — currently a stub with basic error handling

  • Initial C++ error handler scaffolding for OBS plugin architecture
  • Planned: SAM2-based real-time segmentation for streaming
  • Planned: Background blur and replacement options
  • Note: OBS integration is not yet functional — After Effects integration is the primary focus
04

Performance Optimization

Built for production with scalability and speed in mind

  • GPU acceleration with CUDA support
  • Intelligent batch processing for memory efficiency
  • Downscaling options for faster processing
  • Multi-subject tracking in a single pass

Processing Pipeline

BodyFX implements a sophisticated pipeline that handles everything from video ingestion to After Effects integration, all optimized for production workflows.

BodyFX Processing Pipeline

End-to-end workflow from video input to animated shape layers in After Effects

Command Line Interface

# Basic usage

$ bodyfx-process video.mp4 models/sam_vit_h.pth


# Multi-subject with GPU acceleration

$ bodyfx-process video.mp4 models/sam_vit_h.pth \

--multi-subject --device cuda --batch-size 4

After Effects Integration

The custom ExtendScript (JSX) integration provides a native After Effects experience:

  • • One-click import of segmentation data
  • • Automatic shape layer creation with keyframes
  • • Customizable visual styles (stroke/fill)
  • • Maintains original video timing and dimensions

OBS Studio Plugin (Early Stage)

An OBS plugin for real-time background removal is planned but currently in early exploration. Only a basic C++ error handler file exists as scaffolding. The primary focus of BodyFX is the After Effects segmentation pipeline described above.

Planned OBS Features

  • • SAM2-based real-time segmentation for live streaming
  • • Background blur, replacement, and removal options
  • • GPU-accelerated processing for streaming performance

Note: The OBS plugin is not yet functional. This section describes planned future work.

Technical Innovation

BodyFX applies recent computer vision research to practical production workflows, making GPU-accelerated AI segmentation accessible to creative professionals.

Advanced Segmentation

Transformer-based segmentation model for precise subject isolation

Temporal Consistency

Smart tracking maintains segmentation quality across frames

Custom Prompts

Point or bounding box prompts for targeted segmentation

Batch Processing

Automatic memory management for long videos

Preview Generation

Quick key frame previews before full processing

Easy Installation

pip installable with automatic dependency management

Performance Optimization

The project implements several optimization strategies to handle production workloads:

  • Automatic Batch Size Detection: Dynamically adjusts processing based on available GPU memory to prevent crashes and maximize throughput.
  • Resolution Scaling: Process at lower resolutions for draft work, then full resolution for final output.
  • Model Selection: Choose between three model sizes based on quality requirements and processing speed needs.

Impact & Results

Model Variants
3
Small to Large
ExtendScript Files
7
AE integration
AI Backbone
SAM2
Meta's segmentation model
Integration
AE
After Effects shape layers

Real-World Applications

BodyFX has been designed with production pipelines in mind, offering practical solutions for common VFX challenges:

Film & TV Production

Quick rough cuts for editorial, clean plates for VFX

Live Streaming

Professional streams without green screens, virtual backgrounds

Content Creation

YouTube creators, social media effects, dynamic backgrounds

Remote Work

Professional video calls, virtual presentations, online teaching

Future Development

Planned Features

  • • DaVinci Resolve integration
  • • Premiere Pro plugin
  • • Web-based preview interface
  • • Custom model fine-tuning tools
  • • Mobile app for quick previews
  • • Cloud processing API

Research Directions

Exploring integration with other AI models for enhanced capabilities like 3D depth estimation, motion prediction, and style-aware segmentation.

Next inspection step

Inspect the system further

Use the live surface or the source as the next level of proof. The goal here is not to end on a marketing flourish, but to make the next inspection step obvious.

Source
https://github.com/hopeatina/bodyfx
Why this matters
Strong systems work should be inspectable from multiple angles: interface, architecture, and implementation.