Computer Vision PipelineCASE STUDY N003

VisionTrack CV

AI Multi-Face Attendance & Mask Analytics Suite

PythonOpenCVYOLOv8Dlib 128-DCustomTkinterSQLite WALSMTP Pipeline
01. OBJECTIVE & SYSTEM CONSTRAINTS

The Engineering Problem

A production-grade computer vision suite engineered for automated multi-face batch recognition, mask compliance scoring, and thread-safe SQLite WAL attendance logging.

Systemic Bounds & Operational Constraints:
  • Consistent 60 FPS GUI responsiveness under continuous live video stream processing.
  • Zero database corruption during high-frequency concurrent worker thread writes.
  • Real-time face vector matching against serialized 128-dimensional embedding stores without blocking the main render loop.
02. STACK RATIONALE & ARCHITECTURE DECISIONS
STACK_RATIONALE // VISION_INFRASTRUCTURE
Multithreaded Worker Isolation(vs. Main UI Thread Execution)

Decouples video frame capture and YOLOv8/Dlib model inference into background worker threads communicating via thread queues, maintaining a smooth 60 FPS GUI experience.

YOLOv8 + Dlib 128-D Vectors(vs. Single Object Detectors / Haar Cascades)

Combines Ultralytics YOLOv8 for mask compliance bounding boxes with Dlib 128-dimensional facial vector matching for high accuracy.

SQLite Write-Ahead Logging (WAL)(vs. Standard Rollback Journaling)

Uses WAL mode with explicit mutex locking (threading.Lock) to guarantee database integrity across concurrent background worker threads.

Automated SMTP Daemon Loop(vs. Manual Absentee Reporting)

Background thread evaluates daily cutoff timestamps (e.g. 09:00 AM) and dispatches automated absentee email notices to parents/students.

03. SYSTEM ARCHITECTURE TOPOLOGY

HOVER NODES TO INSPECT SERVICE BOUNDARIES AND IMPLEMENTATION DETAILS

System Boundary: VISIONTRACK CV PIPELINE
// INPUT TIER
RTSP & USB Video Feed
[Frame Acquisition]

OpenCV VideoCapture / RTSP

OPENCV FRAME BUFFER
// PROCESSING TIER
Frame Pre-Processor
[Image Pipeline]

OpenCV / NumPy

YOLOv8 & Dlib Vector Engine
[Inference Engine]

YOLOv8 / Dlib / OpenCV

THREAD-SAFE QUEUE / WAL MUTEX WRITES
// PRESENTATION & PERSISTENCE TIER
CustomTkinter Desktop UI
[Desktop Application]

CustomTkinter / Python

Thread-Safe SQLite WAL DB
[Persistence Store]

SQLite WAL / Thread Lock

RTSP & USB Video Feed [Frame Acquisition]OpenCV VideoCapture / RTSP

Captures live video streams from USB webcams and IP RTSP camera streams.

04. SYSTEM INTERFACES & PLATFORM GALLERY
Operations Dashboard
Operations Dashboard (Light)
Student Registration & Dataset Staging
Student Registration & Dataset Staging (Light)
Live Attendance Session & Camera Feed
Live Attendance Session & Camera Feed (Light)
System Settings & Cutoff Configuration
System Settings & Cutoff Configuration (Light)
05. SUBSYSTEM ARCHITECTURE DEEP-DIVE

4 MASTER SUBSYSTEMS — 3 SQLITE TABLES — 8 CORE PYTHON MODULES

CustomTkinter Desktop Suite
GUI ENGINE

Modern dual-theme presentation suite (Dashboard, Register, Attendance, Records, Settings) running background worker threads for 60 FPS UI responsiveness.

0 SQLite tables|5 views
YOLOv8 & Dlib Vector Pipeline
CV PIPELINE

Batch multi-face detection, Ultralytics YOLOv8 mask compliance bounding boxes (Mask, No Mask, Incorrect), and 128-d Dlib face embedding vector matching.

0 SQLite tables|2 workers
Thread-Safe SQLite WAL Storage
SQLITE WAL

Write-Ahead Logging database engine with explicit threading.Lock mutex guards across students, attendance logs, and audit records.

3 SQLite tables|3 tables
Automated SMTP Absentee Daemon
SMTP DAEMON

Background thread daemon scanning arrival timestamps against daily cutoff settings (e.g. 09:00 AM) and dispatching automated email notices.

0 SQLite tables|1 daemon
06. IMPLEMENTATION CHALLENGES & HARD BUGS
CHALLENGE 01

Thread-Safe SQLite Write-Ahead Logging

Problem Encountered:

Concurrent writes from background face detection threads and GUI operations caused database lock contention and crashes.

Architectural Solution:

Configured SQLite Write-Ahead Logging (WAL) mode paired with explicit Python threading.Lock mutex guards.

System Guardrail:Mutex-protected DB transactions guarantee zero database corruption under continuous multi-thread log dispatches.
CHALLENGE 02

Multi-Face Real-Time Batch Detection

Problem Encountered:

Extracting 128-d facial embeddings for multiple students in a single frame dropped video FPS dramatically.

Architectural Solution:

Engineered asynchronous worker threads and a single-item queue buffer system to detect, embed, and identify multiple faces simultaneously without main thread blocking.

System Guardrail:Single-item frame queue buffer prevents memory backpressure during heavy multi-face frames.
CHALLENGE 03

Threaded Desktop GUI Architecture

Problem Encountered:

Running computer vision models on the main UI thread caused interface freezing and unresponsive controls.

Architectural Solution:

Isolated video capture and model execution inside background worker threads communicating via thread queues.

System Guardrail:Complete decoupling of UI render loop from inference execution guarantees 60 FPS GUI responsiveness.
07. TELEMETRY & METRIC STACK
60 FPS
GUI RESPONSIVENESS
Multithreaded background worker isolation
128-D
FACE EMBEDDINGS
Dlib facial feature vector extraction
SINGLE
FRAME QUEUE
Thread-isolated single-item buffer prevents UI lag
100% WAL
SQLITE INTEGRITY
Write-Ahead Logging mode with mutex DB lock
08. ARCHITECTURAL TRADEOFFS & INSIGHTS
SINGLE-STATION SQLITE WRITE LOCKING: Operating an SQLite WAL database on a single desktop station provides zero-latency local writes, but multi-gate deployment introduces write-lock contention across concurrent stations. Decoupling local frame processing from database persistence via event queues maintains steady 60 FPS GUI performance.
Technology Stack:
PythonOpenCVYOLOv8Dlib 128-DCustomTkinterSQLite WALSMTP Pipeline