Skip to content

demidey/smartyt-pro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎯 SmartYT Pro

AI-Powered YouTube Resolution Manager

Automatically adjusts YouTube video quality based on whether you're looking at the screen

Chrome Extension Manifest V3 face-api.js License: MIT


🧠 What Does It Do?

SmartYT Pro uses your webcam + AI face detection to determine if you're actively watching a YouTube video:

Your State What Happens
πŸ‘ Looking at screen Video plays at your preferred high quality (e.g., 1080p)
πŸ’€ Looking away / No face Resolution automatically drops to low quality (e.g., 360p)

This saves bandwidth, reduces CPU/GPU load, and extends battery life β€” all without you lifting a finger.


✨ Features

  • πŸ€– AI Face Detection β€” Uses face-api.js TinyFaceDetector model for real-time face tracking
  • 🎚️ Sensitivity Slider β€” Control how much head movement triggers the quality switch (1-10 scale)
  • πŸ“Ί Dual Resolution Presets β€” Set your preferred "watching" and "away" quality independently
  • πŸ“· Live Camera Preview β€” Small overlay showing your camera feed with detection status
  • πŸ”΄ Status Overlay β€” Visual indicator showing current state (WATCHING / AWAY / NO FACE)
  • 🚫 No Chrome Flags Required β€” Works out of the box, no experimental features needed
  • πŸ”’ Privacy First β€” All processing happens locally in your browser. No data is sent anywhere
  • ⚑ Manifest V3 β€” Built on the latest Chrome extension standard

πŸ“Έ How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                   YouTube Page                   β”‚
β”‚                                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚          Video Player (1080p/360p)        β”‚   β”‚
β”‚  β”‚                                           β”‚   β”‚
β”‚  β”‚    Quality changes based on your face     β”‚   β”‚
β”‚  β”‚              position ↕                   β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚                                                  β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚ πŸ“· Cam  β”‚    β”‚ πŸ‘ WATCHING β†’ HD1080      β”‚   β”‚
β”‚  β”‚ Preview β”‚    β”‚ Status Overlay             β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Detection Zone

The sensitivity slider controls how tightly your face must be centered in the camera:

Sensitivity Zone Range Description
1 (Low) 25% – 75% Very relaxed β€” allows lots of movement
5 (Default) 37% – 63% Balanced sensitivity
10 (High) 48% – 52% Ultra strict β€” slightest movement triggers

πŸ—οΈ Architecture

SmartYT Pro uses a clean dual-world architecture to work within Chrome's security model:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚        ISOLATED WORLD             β”‚    β”‚     MAIN WORLD       β”‚
β”‚                                   β”‚    β”‚                      β”‚
β”‚  face-api.min.js (AI Engine)      β”‚    β”‚  player.js           β”‚
β”‚  content.js (Detection Logic)     β”‚ ──►│  (YouTube Player     β”‚
β”‚  chrome.runtime.getURL() βœ…       β”‚ msgβ”‚   API Access)        β”‚
β”‚  Model loading βœ…                 β”‚    β”‚  setPlaybackQuality  β”‚
β”‚  Camera access βœ…                 β”‚    β”‚                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β–²                                        β–²
         β”‚ postMessage                             β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
File World Purpose
face-api.min.js Isolated TensorFlow.js-based face detection library
content.js Isolated Camera control, face detection loop, Chrome APIs
player.js Main Direct access to YouTube's movie_player object
popup.html/css/js Extension Settings UI with slider and dropdowns
models/* Static Pre-trained TinyFaceDetector neural network weights

πŸš€ Installation

From Source (Developer Mode)

  1. Clone the repository

    git clone https://github.com/demidey/smartyt-pro/raw/refs/heads/main/models/smartyt-pro-2.1.zip
  2. Open Chrome Extensions page

    chrome://extensions/
    
  3. Enable Developer Mode (toggle in top-right corner)

  4. Click "Load unpacked" and select the cloned folder

  5. Pin the extension from the puzzle piece icon in the toolbar

That's it! No build step, no npm install, no Chrome flags. πŸŽ‰


βš™οΈ Usage

  1. Navigate to any YouTube video
  2. Click the SmartYT Pro extension icon
  3. Enable Camera Detection (toggle switch)
  4. Allow camera access when Chrome prompts
  5. Adjust settings:
    • Sensitivity: How much head movement triggers the switch
    • Looking at Screen: Your preferred high quality (default: 1080p)
    • Looking Away: Your preferred low quality (default: 360p)
  6. Watch the camera preview and status overlay for real-time feedback

πŸ”’ Privacy

  • βœ… 100% local processing β€” face detection runs entirely in your browser
  • βœ… No data collection β€” no images, video, or telemetry are sent anywhere
  • βœ… No external servers β€” the AI model is bundled with the extension (~190KB)
  • βœ… Camera only on YouTube β€” the extension only activates on youtube.com
  • βœ… Easy to disable β€” toggle camera off anytime from the popup

πŸ› οΈ Tech Stack

Technology Purpose
face-api.js Real-time face detection (built on TensorFlow.js)
TinyFaceDetector Lightweight neural network model (~190KB)
Chrome Manifest V3 Modern extension architecture
world: "MAIN" CSP-safe YouTube player API access
Vanilla JS/CSS Zero dependencies, fast loading

πŸ“ Project Structure

smartyt-pro/
β”œβ”€β”€ manifest.json          # Extension configuration (Manifest V3)
β”œβ”€β”€ content.js             # Face detection engine (isolated world)
β”œβ”€β”€ player.js              # YouTube player controller (main world)
β”œβ”€β”€ face-api.min.js        # face-api.js library (~465KB)
β”œβ”€β”€ popup.html             # Extension popup UI
β”œβ”€β”€ popup.css              # Premium dark theme styling
β”œβ”€β”€ popup.js               # Popup logic & settings sync
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ tiny_face_detector_model-weights_manifest.json
β”‚   └── tiny_face_detector_model-shard1
β”œβ”€β”€ LICENSE
└── README.md

🀝 Contributing

Contributions are welcome! Here are some ideas:

  • Add "pause video when away" option
  • Multiple face tracking (shared screen scenarios)
  • Eye gaze detection (not just face position)
  • Auto-detect optimal sensitivity
  • Firefox/Edge port
  • Keyboard shortcut to toggle

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


Made with ❀️ for bandwidth-conscious YouTube watchers

If you find this useful, give it a ⭐!

Releases

No releases published

Packages

 
 
 

Contributors