Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VideoAnalyzerAlgo

A Credit Frame Labeling & Training Tool for video analysis

Phase A of the VideoVault project — build the algorithm first, then the full metadata extraction app.


Attribution

This project builds on and extends closing-credits-recognizer by Farbod Faghihi (© 2019), licensed under the MIT License.

The core idea — framing closing-credit detection as a binary image classification problem — originated from that project. We extend it with:

  • A full interactive web-based frame labeling UI
  • A configurable heuristic scorer (brightness, grayscale ratio, edge density, text line count)
  • A training pipeline with model evaluation
  • Session resumption and per-video progress tracking
  • Timestamp hints from users to accelerate labeling

What This Does

VideoAnalyzerAlgo is a training data collection and model building tool. The goal is to generate a lightweight, accurate classifier that can detect credit frames (opening titl cards and end credits) in movie and TV files — without relying on cloud API calls at runtime.

Workflow

  1. Load a video file → the app reads it read-only and extracts frame metadata
  2. Label frames → use the web UI to classify each frame as End Credit / Opening Credit / Not Credit / Skip
  3. Provide timestamp hints → optionally tell the app where credits start/end to speed up labeling
  4. Train → use your labeled frames to train a Random Forest classifier
  5. Evaluate → review accuracy, F1 score, and confusion matrix
  6. Export → the trained model is saved to ./models/ for use in Phase B (VideoVault)

Safety Rules

⚠️ This application will NEVER:

  • Modify any video file contents
  • Delete any file
  • Rename any file

It is a read-only analysis and labeling tool in Phase A. All file modification features (title/metadata writing, rename) are disabled by default and, when enabled in Phase B, always require explicit user confirmation with before/after preview.


Quick Start

Requirements

  • Python 3.11+
  • ffmpeg on your system PATH (for video metadata)

Windows

run.bat

Linux / macOS

chmod +x run.sh
./run.sh

The app will open at http://localhost:8765


Manual Setup

python -m venv venv
# Windows:
venv\Scripts\activate
# Linux/macOS:
source venv/bin/activate

pip install -r requirements.txt
python run.py

Project Structure

VideoAnalyzerAlgo/
├── app/
│   ├── main.py              # FastAPI entry point
│   ├── config.py            # App configuration + safety rules
│   ├── core/
│   │   └── frame_extractor.py   # OpenCV frame extraction + heuristic scoring
│   ├── db/
│   │   ├── models.py            # SQLAlchemy models
│   │   └── crud.py              # DB operations
│   ├── api/
│   │   ├── schemas.py           # Pydantic schemas
│   │   ├── routes_library.py    # Video and label API
│   │   ├── routes_training.py   # Training pipeline API
│   │   └── routes_settings.py   # Settings API
│   └── ui/
│       ├── templates/           # Jinja2 HTML pages
│       └── static/css/          # Dark-mode stylesheet
├── data/
│   └── videovault.db        # SQLite — persists across updates
├── models/                  # Trained model files (.pkl)
├── config.json              # User configuration
├── requirements.txt
├── run.py                   # Main launcher
├── run.bat                  # Windows launcher
└── run.sh                   # Linux/macOS launcher

Keyboard Shortcuts (Labeler)

Key Action
E Label as End Credit
O Label as Opening Credit
N Label as Not Credit
S Skip frame
Next frame
Previous frame

License

MIT License. See LICENSE.

Original work by Farbod Faghihi — parallel-places/closing-credits-recognizer.

About

Credit Frame Labeling & Training Tool — Phase A of VideoVault

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages