RavindranadhM's picture
Add detector-first steel ROI gate and training toolkit
a3abb2d verified
Raw
History Blame Contribute Delete
6.29 kB
export const systemBrief = {
title: "Manufacturing Monitoring System",
goal:
"A real-time industrial monitoring platform for steel quality inspection with ROI localization, defect segmentation, automated reporting, database logging, and WebSocket-driven live operations.",
architectureFlow: [
{
title: "Camera and Image Intake",
detail: "Collect uploaded inspection images or live browser camera frames from the shop floor.",
},
{
title: "Steel ROI and Defect Engine",
detail: "Localize the steel inspection region first, then run defect segmentation only inside that ROI to reduce false positives.",
},
{
title: "Inspection Formatter",
detail: "Normalize decisions, recommendations, defect summaries, and annotated preview output.",
},
{
title: "Operational Data Layer",
detail: "Store JSON reports locally and persist inspection records to PostgreSQL when configured.",
},
{
title: "FastAPI Control Layer",
detail: "Expose REST endpoints for reports, analytics, uploads, camera frames, and system health.",
},
{
title: "WebSocket Event Stream",
detail: "Broadcast inspection snapshots and live updates to all connected operator dashboards.",
},
{
title: "React Monitoring Console",
detail: "Present live status, history, analytics, and camera-based inspection in a clean UI.",
},
],
backend: {
responsibilities: [
"Serve inspection data through REST endpoints.",
"Push real-time updates through WebSocket connections.",
"Connect to PostgreSQL through Supabase or fall back to local report storage.",
],
files: [
{
title: "api/main.py",
detail: "FastAPI app, REST endpoints, and /ws WebSocket entry point.",
},
{
title: "core/database.py",
detail: "Safe database access layer with optional runtime fallback.",
},
{
title: "core/config.py",
detail: "Environment-backed application settings and path configuration.",
},
{
title: "core/logger.py",
detail: "Structured logging for debugging and operational tracing.",
},
],
},
aiPipeline: {
files: [
{
title: "live_camera.py",
detail: "Simulated camera loop for offline inspection playback with the trained model.",
},
{
title: "inspection/service.py",
detail: "Unified runtime service for upload inspection, camera-frame inference, and preview overlays.",
},
{
title: "inspection/output_formatter.py",
detail: "Formats defect data, writes reports, stores records, and triggers live broadcasts.",
},
],
flow: [
{
title: "Capture",
detail: "Acquire a shop-floor image from upload, live camera, or the simulation loop.",
},
{
title: "Validate Surface",
detail: "Localize the steel ROI or reject the frame before segmentation so faces, tools, and background objects do not enter the defect pipeline.",
},
{
title: "Infer",
detail: "Run segmentation only inside the approved steel ROI and extract contours, defect boxes, severity, and geometry.",
},
{
title: "Decide",
detail: "Generate PASS, REVIEW, or FAIL decisions with operational recommendations.",
},
{
title: "Persist",
detail: "Save reports locally and write to PostgreSQL when a database is configured.",
},
{
title: "Broadcast",
detail: "Stream the inspection event to dashboards through WebSocket updates.",
},
],
},
database: {
table: "inspections",
columns: [
"id",
"timestamp",
"total_defects",
"minor",
"moderate",
"critical",
"decision",
"raw_data (JSON)",
],
},
frontend: {
structure: [
"src/components/Sidebar.jsx",
"src/pages/Dashboard.jsx",
"src/pages/History.jsx",
"src/pages/Live.jsx",
"src/pages/Analytics.jsx",
"src/App.jsx",
],
routing: [
"/ -> Dashboard",
"/history -> Inspection logs",
"/live -> Live monitoring",
"/analytics -> Charts and insights",
],
features: [
"Dashboard -> live status, defect counts, active alerts, and WebSocket updates.",
"History -> searchable inspection logs with report detail selection.",
"Live -> upload detection and browser camera inspection with annotated output.",
"Analytics -> Recharts-based trends, defect mix, and source usage.",
],
},
realtime: {
flow: [
"New inspection captured",
"Inspection formatted",
"Local and DB storage written",
"WebSocket event broadcast",
"Dashboard, history, and analytics refresh",
],
},
currentState: {
working: [
"AI detection pipeline",
"Steel ROI gate before defect segmentation",
"Local report persistence",
"REST API",
"Frontend routing",
"Dashboard UI",
"WebSocket live updates",
"Upload and camera inspection endpoints",
],
inProgress: [
"Detector model training with larger curated steel data",
"Cloud LLM API key configuration per deployment",
],
},
improvements: {
backend: [
"Async-safe WebSocket broadcasting.",
"Dropped-connection handling.",
"Graceful database fallback.",
],
frontend: [
"Organized industrial dashboard layout.",
"Clear loading and empty states.",
"Live connection feedback and camera workflow polish.",
],
realtime: [
"WebSocket-first streaming.",
"Heartbeat and reconnect handling.",
"Inspection preview return for live camera frames.",
],
features: [
"Live monitoring with upload and camera options.",
"Steel ROI localization before segmentation.",
"Analytics with inspection trends.",
"Alerts with visual and audio cues.",
],
},
finalSummary:
"This is a full-stack manufacturing monitoring system that localizes the steel inspection region, detects surface defects in real time, stores inspection data, and visualizes live operations through a responsive dashboard.",
}