Skip to content

Latest commit

Β 

History

20 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AttentionX

⚑ AttentionX

AI-Powered Automated Content Repurposing Engine

Turn a 60-minute workshop into a week of viral content β€” automatically.

Demo Video Live App GitHub

Demo Link: https://drive.google.com/file/d/1ZBfFm8Yr2ZhZA5N2Tjnm4bRpFJSWz3bY/view?usp=sharing


🎯 The Problem We Solve

Mentors, educators, and creators produce hours of high-value long-form video. But modern audiences consume content in 60-second bursts. The most profound insights β€” a framework that could change someone's career, a story that reframes everything β€” are buried inside 60-minute recordings that most people never finish watching.

The Wisdom Gap: Valuable knowledge exists. Audiences exist. The bridge doesn't.

AttentionX closes that gap. Upload one session β†’ get a week's worth of viral, vertical, caption-ready clips.


🎬 Demo

β–Ά Watch the full demo on Google Drive

Direct Link: https://drive.google.com/file/d/1ZBfFm8Yr2ZhZA5N2Tjnm4bRpFJSWz3bY/view?usp=sharing

The demo walks through:

  1. Uploading a 60-minute mentorship session
  2. Live emotional peak detection on the waveform timeline
  3. Auto-generated virality scores and hook headlines
  4. Smart 9:16 crop with face tracking
  5. Karaoke-style caption export

✨ Key Features

Feature What it does
Emotional Peak Detection Fuses Librosa audio energy + Gemini sentiment scoring to find the most impactful 60-second windows
Virality Score Each detected clip gets a 0–100% score based on audio intensity, sentiment profundity, and content type
Smart Vertical Crop MediaPipe face tracking keeps the speaker centered in a 9:16 frame β€” no manual cropping
Karaoke Captions Word-level Whisper timestamps drive animated, high-contrast caption overlays
Hook Headline Generator Gemini generates a scroll-stopping 5–8 word headline for each clip automatically
One-Click Export Burned-in captions + title card + 9:16 vertical MP4 ready for TikTok, Reels, and Shorts

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    React Frontend (Vite)                  β”‚
β”‚         Upload Zone β†’ Peak Timeline β†’ Clip Preview        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚ REST API
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  FastAPI Backend (Python)                  β”‚
β”‚            Job Queue β†’ Status Updates β†’ Storage           β”‚
β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚                                      β”‚
β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  AI Analysis     β”‚              β”‚  Video Processing       β”‚
β”‚  Pipeline        β”‚              β”‚  Engine                 β”‚
β”‚                  β”‚              β”‚                         β”‚
β”‚  β€’ OpenAI Whisperβ”‚              β”‚  β€’ MediaPipe face track β”‚
β”‚  β€’ Librosa RMS   β”‚              β”‚  β€’ MoviePy crop/clip    β”‚
β”‚  β€’ Gemini Flash  β”‚              β”‚  β€’ Caption burn-in      β”‚
β”‚  β€’ Virality Fuse β”‚              β”‚  β€’ 9:16 export          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              Supabase (Storage + Postgres)                 β”‚
β”‚         Job tracking Β· Clip storage Β· User data           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🧠 How the Viral Signal Algorithm Works

AttentionX doesn't guess β€” it fuses three independent AI signals to find the golden nuggets:

Signal A β€” Audio Energy (Librosa) Extracts RMS energy per frame, normalizes, and smooths with a rolling average. Detects where the speaker is most passionate and energized.

Signal B β€” Sentiment & Profundity (Gemini 1.5 Flash) Sends the full transcript (Gemini's 1M token context window handles 60+ minute sessions in one call) and scores each segment for: personal vulnerability, counterintuitive claims, actionable frameworks, and quotable one-liners.

Signal C β€” Timestamps (Whisper) Word-level timestamps from OpenAI Whisper power karaoke-style captions β€” each word highlights exactly as it's spoken.

Fusion:

virality_score = (0.4 Γ— audio_energy) + (0.6 Γ— gemini_score)

Top 5 non-overlapping windows (min 90s gap) become your clips.


πŸŽ₯ Smart Crop Logic

16:9 source (1920Γ—1080)  β†’  9:16 output (608Γ—1080)
  1. MediaPipe detects the speaker's face center X coordinate per frame (every 3rd frame for speed)
  2. A 30-frame rolling average smooths the crop window to eliminate jitter
  3. The crop window is clamped to frame bounds so it never goes out of range
  4. MoviePy applies the per-frame crop function at export time

The result: the speaker stays centered in frame throughout the entire clip, even if they move.


πŸš€ Getting Started

Prerequisites

  • Python 3.10+
  • Node.js 18+
  • ffmpeg installed (brew install ffmpeg or apt install ffmpeg)
  • API keys: Google Gemini, OpenAI, Supabase

Installation

# Clone the repository
git clone https://github.com/Piyusha942007/AttentionX-AI.git
cd attentionx

# Backend setup
cd backend
pip install -r requirements.txt
cp .env.example .env
# Fill in your API keys in .env

# Frontend setup
cd ../frontend
npm install
cp .env.example .env.local
# Fill in your Supabase URL and anon key

Environment Variables

Backend .env:

GEMINI_API_KEY=your_gemini_api_key
OPENAI_API_KEY=your_openai_api_key
SUPABASE_URL=your_supabase_project_url
SUPABASE_SERVICE_KEY=your_supabase_service_key

Frontend .env.local:

VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
VITE_API_URL=http://localhost:8000

Running Locally

# Terminal 1 β€” Backend
cd backend
uvicorn main:app --reload --port 8000

# Terminal 2 β€” Frontend
cd frontend
npm run dev

Open http://localhost:5173


πŸ“ Project Structure

attentionx/
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”‚   └── Dashboard.jsx          # Main 3-panel layout
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ UploadZone.jsx         # Drag-and-drop file input
β”‚   β”‚   β”‚   β”œβ”€β”€ PeakTimeline.jsx       # Waveform + peak markers
β”‚   β”‚   β”‚   β”œβ”€β”€ NuggetCard.jsx         # Individual clip card
β”‚   β”‚   β”‚   └── PreviewPane.jsx        # Side-by-side 16:9 / 9:16
β”‚   β”‚   └── App.jsx
β”‚   └── package.json
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ main.py                        # FastAPI app + routes
β”‚   β”œβ”€β”€ models.py                      # Pydantic schemas
β”‚   β”œβ”€β”€ db.py                          # Supabase client
β”‚   β”œβ”€β”€ worker.py                      # Background job processor
β”‚   └── services/
β”‚       β”œβ”€β”€ transcriber.py             # OpenAI Whisper wrapper
β”‚       β”œβ”€β”€ analyzer.py                # Gemini sentiment analysis
β”‚       β”œβ”€β”€ scorer.py                  # Librosa + fusion scoring
β”‚       β”œβ”€β”€ face_tracker.py            # MediaPipe face detection
β”‚       β”œβ”€β”€ cropper.py                 # MoviePy vertical crop
β”‚       └── captioner.py              # Karaoke caption burn-in
β”‚
└── README.md

πŸ› οΈ Tech Stack

Frontend

  • React 18 + Vite
  • Tailwind CSS
  • Recharts (waveform visualization)

Backend

  • FastAPI (Python)
  • asyncio background workers

AI / ML

  • Google Gemini 1.5 Flash β€” sentiment analysis & hook generation
  • OpenAI Whisper β€” transcription with word-level timestamps
  • Librosa β€” audio energy / RMS extraction
  • MediaPipe β€” real-time face detection & tracking

Video Processing

  • MoviePy β€” clip cutting, cropping, export
  • ffmpeg β€” encoding and caption burn-in

Infrastructure

  • Supabase β€” Postgres job tracking + object storage
  • Vercel β€” frontend hosting
  • Railway / Render β€” backend hosting

πŸ“Š Evaluation Criteria Mapping

Criterion How AttentionX delivers
Impact (20%) Turns 1 hour of content into 5 ready-to-publish clips in under 5 minutes
Innovation (20%) 3-signal virality fusion (audio + semantic AI + timing) is novel; no existing tool does this
Technical Execution (20%) Clean modular Python services, typed FastAPI endpoints, React component architecture
User Experience (25%) Premium dark dashboard, real-time waveform, one-click export, demo mode for instant wow
Presentation (15%) Full demo video linked above showing end-to-end flow on a real 60-min session

πŸŽ₯ Recording Your Demo

The demo video is hosted on Google Drive:

β–Ά Watch Demo β€” Google Drive

Link: https://drive.google.com/file/d/1ZBfFm8Yr2ZhZA5N2Tjnm4bRpFJSWz3bY/view?usp=sharing

Replace the link above with your actual Google Drive share link before submission.


πŸ‘₯ Team

Built for the AttentionX AI Hackathon by UnsaidTalks Education

Role Responsibility
Full Stack React dashboard, FastAPI backend, Supabase integration
AI/ML Gemini pipeline, Whisper transcription, virality scoring
Media Engineering MediaPipe tracking, MoviePy crop, caption burn-in

πŸ“„ License

MIT License β€” see LICENSE for details.


Built with ⚑ for the AttentionX AI Hackathon · UnsaidTalks Education · 2026

About

An automated AI engine that extracts "Golden Nuggets" from long-form videos and converts them into viral 9:16 vertical content using Gemini 1.5 Flash, MediaPipe, and MoviePy.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages