No description
Find a file
nickviljoen 418be66498 Merge develop into main: AXA document-mode + Boots PPack + WSJ tuning + docs restructure for v1.2.0
Major additions:
- AXA document-mode QC pipeline: multi-page PDF analysis (Phases 1, 3, 4, 5).
  New profiles axa_policy_document (8 checks) + axa_policy_document_diff (1 check).
  document_mode/ subsystem reused by Boots PPack.
- Boots Production Pack profile: 7-check multi-page document-mode QC built on AXA
  spine, with page classifier (cover/checklist/palette/notes/artwork) and
  artwork-page-only strict-grade exemption. Includes tuned prompts (closed-world
  brand-list semantics, ALL CAPS retail convention exception, stylised logotype
  exception, vision-LLM caveat fields for font weight / superscript / sizing).
- WSJ Static prompt tuning: complete-sentence whitelist for capitalization decision
  tree, graphic/illustrative headline awareness in typography check, split-layout
  logo placement convention, mandatory 30% sizing assessment with score cap.
  Validated across 3 WSJ-NY assets and 3 tuning iterations.

Documentation:
- CLAUDE.md restructured: monolithic 962-line root split into slim 211-line
  project-wide root + per-client CLAUDE_<CLIENT>.md files (10 clients fully
  covered). Auto-loaded session context drops ~88%. Added explicit session-start
  convention pointing to the right client doc.
- Stale 932-line backend/CLAUDE.md replaced with 18-line redirect.

Other:
- Box OAuth (PR1: token storage + redirect URI inference)
- Access-request endpoint fix (list_access_entries iteration)
2026-05-06 12:47:15 +02:00
__pycache__ Updated tool discriptions 2025-12-06 14:54:36 +02:00
backend Restructure CLAUDE.md docs: slim project-wide root, complete per-client coverage 2026-05-06 12:29:16 +02:00
config Compute Box OAuth redirect URI from the request 2026-04-27 15:50:59 +02:00
frontend Update cost estimate to reflect actual usage (50x more accurate) 2026-02-02 13:43:50 +02:00
output Have created Dev and Prod enviroments to test locally 2025-09-11 21:58:44 +02:00
uploads updates 2025-11-06 09:40:34 +02:00
.gitignore PR1: Box.com OAuth + token storage 2026-04-27 15:39:27 +02:00
ai_qc.service Add production deployment migration guide and configuration files 2025-11-06 11:45:31 +02:00
apache_config.conf Add production deployment migration guide and configuration files 2025-11-06 11:45:31 +02:00
AUTH_FIX_GUIDE.md diagnostic test 2026-01-19 22:17:18 +02:00
backend_backup_20251206_153116.tar.gz Improvements to Prod vs Dev testing 2025-12-06 15:39:13 +02:00
CLAUDE.md Restructure CLAUDE.md docs: slim project-wide root, complete per-client coverage 2026-05-06 12:29:16 +02:00
CLAUDE_AMAZON.md Add Boots client QC profile with 5 compliance checks and split CLAUDE.md client docs 2026-04-13 09:25:58 +02:00
CLAUDE_AXA.md Restructure CLAUDE.md docs: slim project-wide root, complete per-client coverage 2026-05-06 12:29:16 +02:00
CLAUDE_BOOTS.md Tune Boots PPack prompts: superscript guard, ALL CAPS / logotype exceptions, weight/sizing limits 2026-05-05 16:26:11 +02:00
CLAUDE_DIAGEO.md Restructure CLAUDE.md docs: slim project-wide root, complete per-client coverage 2026-05-06 12:29:16 +02:00
CLAUDE_DOW_JONES.md Add Boots client QC profile with 5 compliance checks and split CLAUDE.md client docs 2026-04-13 09:25:58 +02:00
CLAUDE_GENERAL.md Restructure CLAUDE.md docs: slim project-wide root, complete per-client coverage 2026-05-06 12:29:16 +02:00
CLAUDE_HONDA.md Restructure CLAUDE.md docs: slim project-wide root, complete per-client coverage 2026-05-06 12:29:16 +02:00
CLAUDE_LOREAL.md Add Boots client QC profile with 5 compliance checks and split CLAUDE.md client docs 2026-04-13 09:25:58 +02:00
CLAUDE_RANK.md Restructure CLAUDE.md docs: slim project-wide root, complete per-client coverage 2026-05-06 12:29:16 +02:00
CLAUDE_UNILEVER.md Restructure CLAUDE.md docs: slim project-wide root, complete per-client coverage 2026-05-06 12:29:16 +02:00
CLEANUP_SUMMARY.md initial commit 2025-08-12 14:52:49 -05:00
config.env SSO Added 2025-08-20 15:30:29 +02:00
debug_mode.txt Updated UI for creating profiles and profile discriptions 2025-12-06 14:32:47 +02:00
DEPLOYMENT_RESTRUCTURE.md Add production deployment migration guide and configuration files 2025-11-06 11:45:31 +02:00
DEPLOYMENT_STEPS.md UI Update to be more BTG look and feel 2025-11-15 10:52:52 +02:00
DEV_PROD_SETUP.md Have created Dev and Prod enviroments to test locally 2025-09-11 21:58:44 +02:00
FOLDER_STRUCTURE.md Create frontend and backend folder structure for deployment 2025-11-06 11:55:53 +02:00
headless_curl_examples.sh initial commit 2025-08-12 14:52:49 -05:00
IMPLEMENTATION_SUMMARY.md Add usage tracking reports, profile versioning, and token tracking 2026-02-02 13:22:33 +02:00
MIGRATION_CHECKLIST.md Add production deployment migration guide and configuration files 2025-11-06 11:45:31 +02:00
MIGRATION_GUIDE.md Add production deployment migration guide and configuration files 2025-11-06 11:45:31 +02:00
MIGRATION_SUMMARY.md Add production deployment migration guide and configuration files 2025-11-06 11:45:31 +02:00
msal_pkce_flow.md SSO Added 2025-08-20 15:30:29 +02:00
README.md Update READMEs for user access control and new deploy flow 2026-04-22 18:49:24 +02:00
REORGANIZATION_COMPLETE.md Add reorganization completion summary document 2025-11-06 11:57:31 +02:00
requirements.txt Add OCR layout measurement module for precise spatial QC checks 2026-04-02 11:00:07 +02:00
server.log initial commit 2025-08-12 14:52:49 -05:00
server_debug.log initial commit 2025-08-12 14:52:49 -05:00
web_ui.html Add AXA document-mode QC pipeline (Phases 1, 3, 4, 5) 2026-05-01 18:38:14 +02:00

Visual AI QC - AI-Powered Quality Control Platform

AI-driven visual quality control for marketing materials and design assets using OpenAI GPT-4o and Google Gemini 2.5 Pro. Analyzes images and video against brand guidelines through 75 QC checks, 14 profiles, serving 8 clients.

Work in backend/ Directory

All development and production code is in the backend/ directory.

Directory Structure

ai_qc/
+-- backend/                  # MAIN APPLICATION
|   +-- api_server.py         # Flask application
|   +-- llm_config.py         # LLM configuration (GPT-4o, Gemini 2.5 Pro)
|   +-- ocr_measurement.py    # Tesseract OCR layout measurements
|   +-- profile_config.py     # Profile management
|   +-- client_config.py      # Client configuration (8 clients)
|   +-- pdf_processor.py      # PDF brand guideline processing
|   +-- media_plan_processor.py # Excel media plan parsing
|   +-- usage_tracker.py      # Usage tracking and cost estimation
|   +-- visual_qc_apps/       # QC check modules (75 checks)
|   +-- profiles/             # QC profile configurations (14 profiles)
|   +-- brand_guidelines/     # Reference assets and guidelines DB
|   +-- scripts/              # Deployment and testing scripts
|   +-- config/               # Environment configs
|   +-- uploads/              # File uploads (production)
|   +-- output/               # Generated reports (production)
|   +-- uploads-dev/          # File uploads (development)
|   +-- output-dev/           # Generated reports (development)
|   +-- usage_logs/           # Usage tracking JSONL logs
|   +-- media_plans/          # Uploaded media plans
|   +-- web_ui.html           # Web interface
|   +-- README.md             # Full documentation
|   +-- CLAUDE.md             # Development guide
|
+-- frontend/                 # Frontend-only deployment (optional)
+-- CLAUDE.md                 # Top-level development guide
+-- README.md                 # This file

Quick Start

Local Development

cd backend/
./scripts/run-local.sh
# Access at http://localhost:7183

Deploying to Dev / Prod

Code changes ship through Bitbucket branches (develop → dev server, tagged releases on main → prod server). Deploys are run manually on each server:

ssh <server>
cd /opt/ai_qc
backend/scripts/deploy.sh dev              # dev — pulls latest develop
backend/scripts/deploy.sh prod v1.2.0      # prod — checks out a specific tag
backend/scripts/deploy.sh dev --dry-run    # preview without applying
backend/scripts/rollback.sh last           # revert the most recent deploy
backend/scripts/health-check.sh            # quick "is it alive?"

See backend/CLAUDE.md for the full environment / branch / deploy reference.

Environments

Env URL Branch Status
Local http://localhost:7183 any For active development
Dev https://optical-dev.oliver.solutions/ai_qc/ develop Live
Prod https://optical-prod.oliver.solutions/ai_qc/ main (tagged) Not yet stood up

Clients

Diageo, Unilever, L'Oreal, Amazon, Boots, Dow Jones, Honda, General

Capabilities

  • Image QC: 75 checks across brand compliance, typography, layout, accessibility
  • Video QC: Native Gemini video analysis (visual quality, brand consistency, text legibility, pacing)
  • OCR Measurements: Tesseract pixel-level data for margin and alignment checks
  • PDF Guidelines: Multi-page PDF upload with automatic LLM summarization
  • Media Plans: Excel media plan parsing with asset spec validation
  • Enterprise Auth: Azure AD with MSAL/PKCE and silent token refresh
  • User Access Control: Default-deny per-user client access with admin grant/revoke and audit log
  • Admin Panel: Usage analytics, user tracking, cost estimation, access management
  • Profile Versioning: Automatic version control on profile edits

Documentation

  • Full Documentation: See backend/README.md
  • Development Guide: See backend/CLAUDE.md
  • Deployment Guide: See backend/DEV_PROD_SETUP.md