Skip to content

Libiv/Vera

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

179 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

VERA (Voice - Expression & Reaction Analysis)

Python License Status

VERA is an advanced multi-modal AI pipeline designed to analyze communication performance. It processes video input to evaluate Face (micro-expressions, gaze), Body (posture, gestures), and Audio (tonality, pacing) metrics. By leveraging computer vision and audio signal processing, VERA provides objective, data-driven feedback to help users improve their communication skills.

🌟 Why VERA?

Public speaking and communication are critical soft skills for Founders, Students, and Executives. Yet, feedback is often subjective and scarce.

VERA solves this by providing:

  • Scientific Objectivity: Moving beyond "you look nervous" to "your gaze stability dropped by 20%".
  • Holistic Feedback: Analyzing not just what you say, but how you say it (Face, Body, Voice).
  • Automated Coaching: offering actionable tips based on your specific communication persona.

πŸš€ Key Features

  • Multi-Modal Analysis: Parallel processing of visual signals (using MediaPipe) and auditory signals (using Librosa).
  • 14 Core Metrics: Comprehensive tracking of engagement indicators (e.g., Gaze Stability, Gesture Magnitude, Vocal Punch).
  • Persona K-means Clustering: Unsupervised ML that automatically assigns a "Communication Persona" based on high-dimensional metric clusters.
  • Rich Visualization: Generates debug videos with skeletal overlays to visualize exactly what the AI sees.

πŸŽ₯ Showcase & Examples

We provide sample outputs in the assets/examples/ directory to demonstrate VERA's capabilities:

File Description
debug_face.mp4 Visualizes 468 facial landmarks, gaze tracking vectors, and head pose estimation.
debug_pose.mp4 Shows skeletal tracking (33 keypoints), gesture amplitude, and posture analysis overlay.
analysis_results.json Full JSON output containing all 14 metrics, scores, and coaching tips.

(Note: To view these, navigate to the assets/examples/ folder)


πŸ“‚ Project Structure

VERA/
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ clustering_dataset/      # ML dataset for persona clustering
β”‚   β”œβ”€β”€ processed/               # Pipeline output for CLI runs
β”‚   └── raw/                     # Input videos
β”œβ”€β”€ front-end/
β”‚   β”œβ”€β”€ app.py                   # Streamlit Dashboard application
β”‚   └── processed/               # Pipeline output for UI runs
β”œβ”€β”€ notebooks/                   # Jupyter notebooks for experimentation & viz
β”œβ”€β”€ reports/                     # Calibration manifests and analysis reports
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ analysis/                # Data enrichment, scoring, and prediction logic
β”‚   β”œβ”€β”€ audio/                   # Audio extraction & processing (Librosa)
β”‚   β”œβ”€β”€ body/                    # Body pose extraction (MediaPipe Pose)
β”‚   β”œβ”€β”€ face/                    # Facial landmark extraction (MediaPipe FaceMesh)
β”‚   β”œβ”€β”€ presentation/            # Result formatting and enrichment
β”‚   β”œβ”€β”€ schemas/                 # JSON schemas (single source of truth for text)
β”‚   β”œβ”€β”€ utils/                   # Shared utilities (IO, logging)
β”‚   └── main.py                  # CLI Entry point & Orchestrator
└── README.md

πŸ› οΈ Installation

Prerequisites

  • Python 3.10+
  • ffmpeg (Required for audio processing. Install via brew install ffmpeg on Mac or apt install ffmpeg on Linux).

Setup

# Clone the repository
git clone https://github.com/WiwiC/VERA.git
cd VERA

# Create a virtual environment
python -m venv VERA-env
source VERA-env/bin/activate  # or VERA-env\Scripts\activate on Windows

# Install dependencies
pip install -r requirements.txt

πŸ’» Usage

1. Run Analysis (CLI)

To analyze a single video file directly from the terminal:

python src/main.py <path/to/video.mp4>
  • Output: data/processed/<video_filename>/

2. Run Dashboard (UI)

To analyze videos and visualize results in the interactive dashboard:

streamlit run front-end/app.py
  • Output: front-end/processed/<video_filename>/

3. Input specifications

  • File Types: .mp4 or .MOV.
  • Duration: Recommended 1 to 2 minutes (e.g., elevator pitch).
    • Note: This is a prototype. A 1 min video takes ~2 min to process.
  • Camera Setup:
    • Front-facing camera.
    • Camera at eye level.
    • Framing: Ensure body is visible from hips to head to capture hand gestures.

πŸ“Š Metrics Guide

All text definitions, coaching tips, and interpretation labels are centralized in:

src/schemas/metrics_spec.json

Important: This file is the "Source of Truth". It should be kept in synchronization with the numerical thresholds defined in src/*/config.py.

Module Metric Description
Face head_stability Measures head steadiness (nodding vs. frozen).
Face gaze_stability Tracks eye contact focus and consistency.
Face smile_activation Measures smile intensity and frequency.
Face head_down_ratio Percentage of time looking down.
Body gesture_magnitude Expansiveness/size of hand gestures.
Body gesture_activity Speed and frequency of gestures.
Body gesture_stability Smoothness vs. jitteriness of movement.
Body body_sway Torso movement (rocking vs. grounded).
Body posture_openness Shoulder/chest openness.
Audio speech_rate Words per minute (WPM).
Audio pause_ratio Ratio of silence to speech.
Audio pitch_dynamic Tonal variation (avoiding monotone).
Audio volume_dynamic Loudness variation.
Audio vocal_punch Peak volume clarity and emphasis.

πŸ§ͺ Calibration Process

To ensure scientific rigor, VERA uses a calibration system to fine-tune scoring thresholds.

How it works

  1. Labeled Data: We maintain a reports/calibration_manifest.csv containing videos labeled by human experts (scores 0-100).
  2. Analysis Scripts: Scripts in src/analysis/ (e.g., generate_calibration_report.py) compare VERA's raw outputs against these human labels.
  3. Threshold Tuning: We use final_calibration_search.py to find the optimal parabolic thresholds that maximize correlation with human judgment.

Workflow

  • Add Labeled Videos: Update calibration_manifest.csv with new video paths and manual scores.
  • Run Analysis: Execute python src/analysis/generate_calibration_report.py to see current performance.
  • Update Thresholds: Adjust BASELINE_* constants in src/*/config.py based on the report.
  • Validate: Re-run the report to confirm Spearman correlation improvements.

🧠 Unsupervised Clustering (ML)

VERA uses K-means clustering to identify "Communication Personas" without explicit labels.

  • Dataset: data/clustering_dataset/master_vector_data_set.csv. This file accumulates feature vectors from all processed videos.
  • Mechanism:
    1. Each analysis extracts a high-dimensional feature vector (all 14 metrics).
    2. This vector is added to the master dataset.
    3. We run K-Means to find natural groupings (e.g., "The Orator", "The Jittery Speaker").
    4. New users are assigned to the nearest cluster center to predict their persona.

πŸ—οΈ Architecture

The pipeline follows a linear data flow:

graph LR
    A[Video Input] --> B(Extraction)
    B --> C{Multimodal Processing}
    C -->|Face| D[FaceMesh + Gaze]
    C -->|Body| E[Pose Landmarks]
    C -->|Audio| F[Librosa Spectral]
    D --> G[Raw 1s Timeline]
    E --> G
    F --> G
    G --> H[5s Rolling Window]
    H --> I[Scoring Engine]
    I --> J[Enrichment & Coaching]
    J --> K[JSON & Dashboard Output]
Loading

πŸ“ˆ Accuracy & Scientific Notes

We prioritize metrics that show strong correlation with communication effectiveness. Based on our latest calibration:

  • Strong Signals: speech_rate, gaze_stability, gesture_magnitude show high Spearman correlation (>0.7) with human expertise.
  • Noisy Signals: micro_expression_energy was removed due to low reliability in uncontrolled lighting.
  • Calibration: The tiered parabolic scoring helps normalize differences between webcam hardware.

❓ Troubleshooting

Issue Solution
ffmpeg not installed Install FFmpeg system-wide. Audio processing will fail without it.
MediaPipe failing Ensure good lighting and that the face is fully visible/unobstructed.
Missing folders Run python src/main.py once to auto-generate data/processed.
CUDA error VERA defaults to CPU to ensure compatibility. If verifying CUDA, check torch version.

πŸ”’ Privacy & Security

  • Local Processing: All analysis happens locally on your machine.
  • No Cloud Storage: Videos are not uploaded to any external server.
  • User Control: You retain full ownership of your data and bio-metric information.
  • No Tracking: No third-party analytics or tracking pixels are used.

πŸ“œ License

MIT License Copyright (c) 2025 WiwiC


✍️ Credits

About

A multimodal communication-analysis coach built with pretrained models, unsupervised ML and LLM agentic

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages