Skip to content

KrishP147/frameshift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

100 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FrameShift Logo

AI-powered video editing. Click an object, apply an edit, propagate across every frame.

Built by Krish Punjabi, Bryan Lin, Justin Wang, and Daniel Zhao.


Overview

FrameShift lets you edit objects in video without frame-by-frame manual work. Upload a video, click any object, and apply edits like recolor, remove, resize, or replace — the changes automatically propagate across your entire clip.

Landing Page

Features

Feature Overview

  • AI Object Detection — YOLOv11 automatically detects every object in your video. Select any object just by clicking on it.
  • Background Removal — Remove or swap backgrounds instantly with AI-generated scenes.
  • Color Grading — Change the color of any detected object across all frames.
  • Smart Resize — Reformat for any platform in one click.

How It Works

1. Upload your video

Drag and drop or upload from your device. FrameShift extracts every frame and runs object detection in the background.

2. Select an object

Click any detected object in the editor. SAM 2 segments it precisely and tracks it across frames.

Object Selection

3. Apply edits

Use the toolbar to remove, recolor, resize, blur, or replace objects. Apply whole-frame effects like background removal, enhance, upscale, or restore. Or describe your edit in natural language with the AI Edit panel.

Editor View

4. Propagate to all frames

One click propagates your edit across the entire frame range. Preview the result, then render your final video.

AI Edit Applied

Tech Stack

Layer Tech
Frontend Next.js 15, Tailwind CSS, Auth0
Backend FastAPI, Python
Object Detection YOLOv11 (Ultralytics)
Segmentation SAM 2
Storage & Media Cloudinary
Database Supabase (Postgres)
Frame Processing FFmpeg

Architecture

Video Upload → FFmpeg Frame Extraction → YOLOv11 Detection
                                              ↓
              Click Object → SAM 2 Segmentation + Tracking
                                              ↓
            Apply Edit → Cloudinary Transforms (per frame)
                                              ↓
              FFmpeg Re-encode → Final Video via Cloudinary

Supported Edits

Object-Level (SAM 2 mask)

Edit Description
Recolor Change the color of a specific object
Resize Scale an object in place
Remove AI-powered object removal
Replace Swap an object with AI-generated content from a text prompt
Blur Blur only the masked region (faces, license plates, etc.)

Whole-Frame

Effect Description
Background Remove Remove background, keep foreground
Background Replace Replace background with an AI-generated scene
Enhance AI quality and detail improvement
Upscale AI resolution upscaling
Restore Fix compression artifacts and noise
Blur Apply blur to the entire frame

AI Edit

Describe your edit in natural language (e.g., "make the person in the middle red") and FrameShift applies it.

Editor with AI Edit

Getting Started

Prerequisites

  • Node.js 18+
  • Python 3.10+
  • FFmpeg installed and on PATH
  • Cloudinary account
  • Supabase project
  • Auth0 application

Backend

cd backend
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt

Download the SAM 2 checkpoint:

mkdir checkpoints
curl -L -o checkpoints/sam2_hiera_tiny.pt \
  https://dl.fbaipublicfiles.com/segment_anything_2/072824/sam2_hiera_tiny.pt

Create backend/.env:

CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
SUPABASE_URL=your_supabase_url
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
AUTH0_DOMAIN=your_auth0_domain
AUTH0_AUDIENCE=your_auth0_audience

Start the server:

uvicorn main:app --reload

Frontend

cd frontend
npm install

Create frontend/.env.local:

NEXT_PUBLIC_API_URL=http://localhost:8000
AUTH0_SECRET=your_secret
AUTH0_BASE_URL=http://localhost:3000
AUTH0_ISSUER_BASE_URL=https://your-tenant.us.auth0.com
AUTH0_CLIENT_ID=your_client_id
AUTH0_CLIENT_SECRET=your_client_secret
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME=your_cloud_name
NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET=your_upload_preset

Start the dev server:

npm run dev

App runs at http://localhost:3000.

API Endpoints

Method Path Description
POST /upload Create project, upload video to Cloudinary
POST /extract Extract frames with FFmpeg, run YOLO detection
GET /project/{id}/status Poll extraction status and frame count
GET /frame/{id}/{index} Serve a specific frame as JPEG
POST /detect On-demand YOLO detection for a single frame
POST /segment SAM 2 segmentation + propagation
POST /edit Apply batch edit rules across frame ranges
POST /render Re-encode video with FFmpeg, upload to Cloudinary

About

Submission to Hack Canada 2026: FrameShift is an AI-powered video editor that lets users upload a video, click on any object to segment it using SAM2, and apply edits VIA Cloudinary.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors