CASE / 01Computer Vision · Edge Systems · Model Governance

Real-Time Multi-Camera Surface Inspection

One production chain from acquisition to evidence, review, and model governance.

PythonPyTorchOpenCVDjangoRedisVue 3.NET
Synthetic-data public demo of the live multi-camera inspection workspace

01 / Overview

RoleVision Pipeline & System Engineer
FocusMulti-camera acquisition / Inference / Traceability / Governance
StackPython, PyTorch, OpenCV, Django, Redis, Vue 3, .NET
ContextConfidential industrial deployment; GPL-3.0-only public frontend rebuilt with synthetic data

03 / The problem

The engineering problem was larger than training a detector. Six line-scan views had to be acquired without blocking the production path, associated with the correct workpiece and section, processed through preprocessing and defect inference, and turned into durable evidence that operators could inspect and review.

Constraints

01Six-view acquisition and edge bandwidth02Preview and formal detection isolation03Workpiece and section lineage04Rare defects and hard negatives05Durable review evidence

04 / System approach

Separate the hot path, business truth, and review loop—then make every boundary observable.

01Edge AcquisitionSIX VIEWS
02Preprocess + ROIMICRO-BATCH
03Anomaly + DefectINFERENCE
04Evidence + ReviewDURABLE LOOP
01

Preview frames travel directly from edge capture to the browser, while formal frames are persisted and acknowledged before asynchronous inference. Runtime state, defect events, image evidence, and review changes remain separate but traceable contracts.

05 / System architecture

Four modules, three data planes, one traceable inspection contract.

The architecture separates runtime control, latest-only preview, and durable formal inspection. The public description preserves verified software boundaries and waiting semantics while omitting client identity, site topology, storage addresses, alarm thresholds, credentials, capacity settings, and production parameters.

01Vue 3 · Vite

Frontend

Operator workspace

  • Six-camera overview, fused view, and focused inspection
  • Live runtime state and defect-event updates
  • History retrieval and image-level review
  • Model, sample, parameter, and alarm governance
02Django · Channels · Redis · MySQL

Backend

Business truth and orchestration

  • Own workpiece, section, and runtime identity
  • Acknowledge formal-frame ingress and schedule workers
  • Persist frame, image, detection, and review lineage
  • Expose REST, event WebSocket, and governance APIs
03.NET 10 · SaperaLT

Capture

Six-view edge acquisition

  • Drive six line-scan cameras across two logical edge nodes
  • Serve latest-only raw, focused, and fused preview streams
  • Gate formal capture with frozen runtime context
  • Write original images before submitting metadata
04Flask · OpenCV · anomalib · Ultralytics

Algorithm

Vision inference service

  • Run preprocessing and ROI extraction
  • Batch anomaly and defect inference
  • Read images from shared storage by location
  • Return detections, positions, and evidence metadata

05.1 / MODULE COMMUNICATION MAP

One system, three paths with different guarantees.

Control, preview, and formal inspection have different consistency and latency goals. Separating them prevents operator visibility, business truth, and inference throughput from blocking one another.

Low latency / latest-onlyDurable / traceableControl and business context
CONTROL PLANE

Runtime control

Production signalsSignal and identity

Establish the current workpiece, section, and phase

Runtime adapter
BackendBusiness truth

Own runtime state and the frozen context

Runtime control
CaptureCapture gate

Use the complete snapshot to permit formal frames

PREVIEW PLANE

Live preview

CaptureCamera callbacks

Build per-camera, focused, and fused previews

Memory / JPEG
Edge streamKeep the newest frame

Older views may be overwritten under pressure

Preview WebSocket
FrontendOperator workspace

Consume preview without waiting for inference

FORMAL PLANE

Formal inspection

CaptureFreeze formal frame

Bind frame, workpiece, section, and camera identity

Durable write
Shared storagePersist original image

Keep large image bytes in the data plane

JSON ingress
BackendValidate and acknowledge

Queue the path and context, then release capture

HTTP batch
AlgorithmBatch vision inference

Read by location and run preprocess, anomaly, and defect

REST + Events
Backend / FrontendEvidence loop

Persist, emit deltas, and review on demand

Key rule: preview frames may be overwritten; formal frames require frozen identity, a durable location, and a retryable processing record.

05.2 / FORMAL INSPECTION FLOW

A formal inspection secures identity before optimizing throughput.

The capture callback forks immediately. Preview serves operator visibility; the formal branch builds durable lineage from original image and job to model result and human review.

BACKENDEstablish runtime identity

Confirm the current workpiece, section, and phase

BACKEND → CAPTURESend a complete control snapshot

Include formal-binding permission and frozen context

CAPTUREReceive six-view callbacks

Split preview frames from formal frames at the source

PREVIEWDROPPABLE, LATEST-ONLY
PREVIEW

Deliver the newest view

No business queue or durable record; freshness wins under pressure.

FORMALDURABLE, RETRYABLE, AUDITABLE
01 / CAPTURE

Persist the original first

Submit location and frozen metadata only after the write succeeds.

02 / INGRESS

Validate, deduplicate, and ACK

ACK means scheduled—not inspected.

03 / WORKER

Durable work and bounded batches

The queue absorbs inference variance; workers form micro-batches.

04 / ALGORITHM

In-process vision pipeline

Read shared images and preserve source coordinates through ROI, anomaly, and defect stages.

05 / BACKEND

Attach lineage and persist

Map results back to frame, camera, section, and model version.

06 / FRONTEND

Emit deltas and review on demand

Lightweight events update live state; REST loads complete evidence.

INVARIANT

Even when inference returns late, a result can only update the frame and section frozen at ingress; it must never infer ownership from the browser's current state.

05.3 / KEY SEQUENCE

Fast acknowledgement decouples capture latency from inference latency.

The order and waiting boundaries matter: persist the original before submitting metadata; acknowledge ingress without waiting for the model; send a lightweight delta before loading full evidence on demand.

01Signals
02Backend
03Capture
04Storage / Queue
05Algorithm
06Frontend
A / ESTABLISH RUNTIME CONTEXT
Runtime edge and identityEstablish workpiece and section truth
Complete control snapshotFormal permission and frozen context
Preview frameLatest-only; outside the formal path
B / ACCEPT FORMAL FRAME
Persist original imageComplete the durable write first
Location and frozen contextJSON ingress; no large image bytes
Append durable workValidate and deduplicate before queueing
ACCEPTEDDoes not wait for inference or persistence
C / INFERENCE AND EVIDENCE LOOP
Batch job and runtime contextBounded batching and model binding
Read image by locationImage bytes stay out of the business API
Structured detectionsROI, boxes, coordinates, and version evidence
Realtime detection deltaLightweight event; no full image payload
Detail request / reviewLoad on demand and write review state
Complete traceable evidenceImage, boxes, position, and audit context

Only public software contracts are shown. Site addresses, credentials, thresholds, capacity settings, and production performance remain private.

05.4

Communication contract index

01Production signalsRuntime adapterBackend

Create the authoritative workpiece and section context.

02BackendRuntime/control contextCapture

Provide the authoritative identity and gate conditions for formal capture.

03CapturePreview WebSocketFrontend

Deliver latest-only camera and fused views without entering the formal path.

04CaptureJSON ingressBackend

Submit image locations with frozen business context after durable write.

05BackendRedis workers + HTTP batchAlgorithm

Decouple fast acknowledgement from bounded micro-batch inference.

06AlgorithmStructured resultBackend

Return detections that are persisted and mapped to frame and section lineage.

07BackendREST + event WebSocketFrontend

Serve history and detail on demand while pushing lightweight live deltas.

05.5

Detection path, step by step

  1. 01

    Freeze runtime identity

    The backend establishes the current workpiece and section; capture freezes that context onto each formal frame.

  2. 02

    Persist before ingress

    Capture writes the original image first, then submits its storage location and metadata instead of moving image bytes through the API.

  3. 03

    Acknowledge and queue

    The backend validates and quickly acknowledges ingress, placing durable work on Redis so acquisition is not blocked by inference.

  4. 04

    Batch vision inference

    Workers group bounded jobs; the algorithm service reads shared images and runs preprocessing, ROI, anomaly, and defect stages.

  5. 05

    Persist evidence and emit deltas

    Returned detections are attached to their frozen lineage, stored, and reduced to lightweight realtime events.

  6. 06

    Review and govern

    Operators retrieve full evidence on demand; review outcomes feed sample curation and controlled model iteration.

06 / Technical challenges

01

Keep preview out of the formal path

Use latest-only edge streams for operator visibility while reserving durable storage and inference capacity for formally bound frames.

02

Preserve identity across overlap

Freeze workpiece and section context with each formal frame so delayed inference cannot attach evidence to a newer production state.

03

Turn detections into reviewable evidence

Index full-section imagery, map detections back to camera and position, and load detailed evidence on demand instead of flooding the browser.

04

Govern model change

Separate preprocessing, anomaly, and defect model versions, then connect review outcomes and sample governance to controlled iteration.

07 / Outcome

Outcomes bounded by available evidence.

The capabilities below were verified against the internal implementation and maintained engineering documentation. Client identity, site topology, production imagery, throughput, accuracy, alarm rules, and deployment addresses remain private. Every number shown in the public UI is illustrative—not a production result.

01Six-view edge acquisition with fused and focused inspection viewsIMPLEMENTATION VERIFIED
02Durable frame-to-section-to-defect evidence lineageIMPLEMENTATION VERIFIED
03Real-time events, historical retrieval, and image-level human reviewIMPLEMENTATION VERIFIED
04Versioned preprocessing, anomaly, and defect model governanceIMPLEMENTATION VERIFIED
Next case study

WordScene / 译笺