Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Data Center Monthly Monitoring OCR

This OCR-assisted encoding application converts photographed or scanned Toyota Data Center Monthly Monitoring Sheets (PNG, JPEG, or PDF) into human-verified temperature and humidity records, executes standard operational diagnostics, and exports the data into the official Excel template.

The system is designed as a human-in-the-loop workflow. PaddleOCR proposes readings, while uncertain, malformed, anomalous, or out-of-limit readings are surfaced with their exact extracted handwritten crops for rapid verification.


Main Features

Intake & Queue Processing

  • Accepts multiple PNG, JPG, JPEG, and PDF monitoring-sheet uploads.
  • Splits multi-page PDFs into selectable per-page queue items.
  • Automatically rotates confident sideways portrait scans using form layout geometry.
  • Provides manual page orientation override before extraction preparation.
  • Prewarms PaddleOCR deep-learning recognition weights into memory on application startup.
  • Multi-sheet background processing: verify Sheet 1 while Sheet 2 processes in the background.

Geometry & Grid Extraction

  • Detects and perspective-straightens photographed or scanned monitoring tables.
  • Identifies the full 32-line printed Day 1–31 row sequence.
  • Generates straight fixed and locally calibrated extraction previews.
  • Extracts all 496 measurement cells (31 days × 8 points × 2 readings) with blank classification.

Verification Acceleration Hub

  • 31-Day Status Matrix & Heatmap Strip: Color-coded status pills (Confirmed, Clean, Attention Required, Blank) with 1-click day jumping.
  • 1-Click Clean Day Confirmation: Confirms all 100% compliant, high-confidence days in a single action.
  • Smart Navigation (Next Flagged Day): Skips confirmed clean days and jumps directly to the next day requiring human verification.
  • Month Presets: 1-click batch blanking for 30-day months (April, June, Sept, Nov) or February (28/29 days).
  • Candidate OCR Suggestion Hints: Displays alternate OCR readings beneath ambiguous values (e.g. Candidates: 22.1, 28.1).

Official SOP Severity Engine

Automatically evaluates readings against official company Standard Operating Procedures:

  • Temperature:
    • $\le 17.0^\circ\text{C}$ (Below Normal): Action 3: Turn off one (1) backup ACU.
    • $18.0 - 27.0^\circ\text{C}$ (Normal): Standard compliant operations.
    • $> 27.0 - 30.0^\circ\text{C}$ (Warning): Action 1: Guard on Duty must Report to GSD/IT within 2 hours.
    • $> 30.0^\circ\text{C}$ (Critical): Action 2: Guard on Duty must Report to GSD/IT immediately for possible server shutdown and ACU repair.
  • Humidity:
    • $< 30.0%$ (Below Normal): Low humidity ESD risk advisory.
    • $30.0 - 60.0%$ (Normal): Standard compliant operations.
    • $61.0 - 70.0%$ (Warning): Action 1: Report to GSD/IT within 2 hours.
    • $\ge 71.0%$ (Critical): Action 2: Report to GSD/IT immediately.

Monthly Environmental Diagnostics & Analytics Dashboard

  • Executive KPIs: Overall Facility Compliance %, Avg/Min/Max Temperature, Avg/Min/Max Humidity, Total SOP Incident count.
  • Hotspot Diagnostics: Identifies the hottest location, coolest point, and humidity extremes.
  • 31-Day Trend Charts: Multi-point interactive trendlines for temperature and humidity across all 8 monitoring points.
  • Point-by-Point Distribution: Full statistical breakdown of Points 1 to 8.
  • SOP Incident & Action Procedure Log: Chronological incident table showing breaches and mandatory SOP actions.
  • Report Downloads:
    • Completed Excel Workbook: Populates the official Toyota monitoring template, preserving all original formulas, logos, borders, and print layout.
    • Executive Diagnostics Report (HTML): Printable executive summary report with company letterhead styling.
    • Diagnostics Incident Log (CSV): Machine-readable incident log.
    • Excel Mapping Audit (CSV): Exact cell-by-cell mapping destination audit.

Technology Stack

  • Python 3.13
  • Streamlit for the web application UI
  • OpenCV for table detection, perspective warp, preprocessing, cropping, and blank analysis
  • PaddleOCR & PaddlePaddle for deep learning text recognition
  • NumPy & Pandas for image manipulation and tabular analytics
  • Python ZIP & XML Processing for native template injection without external Excel dependencies

Project Structure

streamlit_app.py                Streamlit UI and session-state orchestration
datacenter_ocr/                 Core processing and business logic:
    background_ocr.py           Background thread worker and prewarming
    day_verification.py         Day verification state and batch acceleration
    demo_dataset.py             Instant 31-day synthetic demo dataset generator
    document_input.py           PDF rasterization and image input decoding
    document_orientation.py     Automatic scan rotation detection
    excel_export.py             Official Excel template XML injection
    grid_diagnostics.py         Table and grid line measurement
    monthly_diagnostics.py      Facility compliance KPIs, charts, and HTML reports
    ocr_processing.py           PaddleOCR inference and consensus
    sheet_processing.py         Table detection and perspective correction
    verification.py             Company thresholds, SOP actions, and validation
docs/                           User guides and deployment documentation
templates/                      Official immutable Excel template
tests/                          Comprehensive unit and UI-contract test suite
scripts/                        Command-line utilities and automated demo runner
installer/                      Offline Windows installer builder and shortcuts

Installation (Offline Windows Setup)

For enterprise workstations and data centers without direct internet access:

  1. Run the DataCenterMonitorOCR-Setup-1.0.0-x64.exe installer.
  2. The installer extracts the bundled Python runtime, offline wheelhouse, and pre-cached PaddleOCR models into %LOCALAPPDATA%\Programs\DataCenterMonitorOCR.
  3. Launch the application via the Data Center Monthly Monitoring OCR Desktop or Start Menu shortcut.

To build the offline installer package from source (requires NSIS 3.12+):

.\installer\build_offline_installer.ps1 -Version 1.0.0

Development Setup

To run from source in PowerShell:

# Create and activate virtual environment
py -3.13 -m venv .venv
.\.venv\Scripts\Activate.ps1

# Install pinned dependencies
python -m pip install --upgrade pip
python -m pip install -r requirements.txt

# Launch the Streamlit application
.\.venv\Scripts\streamlit.exe run streamlit_app.py

Running Automated Tests & Demos

# Run the 142-test automated unit suite
.\.venv\Scripts\python.exe -m unittest discover tests

# Run the 1-second automated capability demo (no OCR wait)
.\.venv\Scripts\python.exe scripts/run_demo_suite.py

# Verify code compilation
.\.venv\Scripts\python.exe -m compileall -q datacenter_ocr scripts tests streamlit_app.py

Operating Guide

For detailed user instructions, see docs/User_Guide.md.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages