Deploy AI-powered video analytics for workplace safety

Monitor workplace safety and operational compliance in real time using AI object detection, multimodal analysis, and conversational insights.

ManufacturingRed Hat OpenShift AIMultimodal monitoring, object detection, workplace safety

This content is authored by Red Hat experts, but has not yet been tested on every supported configuration.

Deploy AI-powered video analytics for workplace safety

Monitor workplace safety and operational compliance in real time using AI object detection, multimodal analysis, and conversational insights.

Table of Contents

Detailed description

Organizations face challenges maintaining workplace safety and operational compliance across facilities with multiple video feeds. Manual monitoring is resource-intensive and reactive, often missing critical events or patterns that indicate safety risks or operational inefficiencies.

Screenshot of application showing PPE detection

This AI quickstart provides a complete multimodal monitoring solution that combines computer vision and large language models (LLMs) to analyze video streams in real time. The application uses trained object-detection models to identify objects, people, and events in live RTSP feeds or uploaded video files. Users can monitor multiple video sources through an interactive dashboard, view detection overlays, and ask questions about what the AI has observed using a conversational chat interface.

Key capabilities:

  • Real-time analysis: Process live RTSP streams or MP4 files with per-source configuration and model selection
  • Persistent storage: Upload and manage video sources backed by MinIO object storage and PostgreSQL database
  • Visual monitoring: View detection results, overlays, and automated safety summaries through a React dashboard
  • Conversational insights: Query the system using an OpenAI-compatible LLM with LangGraph/LangChain and optional SQL-backed tools
  • Flexible deployment: Run locally with Podman Compose, bare-metal development, or deploy to Kubernetes/OpenShift with Triton/KServe or OpenVINO Model Server
  • Model customization: Train and deploy custom object detection models using the included Jupyter notebook workflow
  • Annotation support: Optional Label Studio integration for creating and refining training datasets

Upload a video or connect an RTSP stream to see the AI detection in action. The dashboard displays:

  • Live video feed with bounding boxes around detected objects
  • Real-time safety and operational summaries
  • Object tracking across frames
  • Interactive chat for querying detection history

See it in action

Interactive walkthrough

Architecture diagrams

Static overview (SVG): docs/images/architecture.svg. Additional slides: docs/architecture-slides.html (see docs/architecture-slides-README.md). The workflow figures below are PNG exports from Mermaid sources (click a diagram to open the full-resolution PNG). See docs/mermaid.README.md for what the .mmd files are and how to regenerate the thumbnails and large images.

Layer / component Technology Purpose / description
UI React, React Router, Axios Dashboard, RTSP/MP4 source selection, configuration page, chat with Markdown
API Flask (/api/*) Config, active source, video feed, chat, uploads
Inference OVMS (ovmsclient) or Triton (tritonclient via KServe) Model serving; gRPC inference from the backend
Tracking BoxMOT (BoostTrack++) Multi-object tracking
LLM OpenAI-compatible API, LangGraph / LangChain Chat; optional read-only postgres-mcp SQL tools
Observability Arize Phoenix (optional) Tracing
Storage MinIO Models, videos, uploads, thumbnails, config objects
Database PostgreSQL Configs, classes, tracks, observations
Prep / seed yolo-model-prep (local), data-loader (init) Export/build model repo from app/models/*.pt; seed MinIO
Annotation (optional) Label Studio Same PostgreSQL + MinIO stack

Video upload workflow

Video upload workflow diagram showing the process from user upload through MinIO storage to database persistence

Application workflow

Application workflow diagram showing the real-time inference pipeline from video source through model serving to UI display

Components

  • Backend (Flask, OpenCV): Video decode, MJPEG output, and drawn overlays; inference over gRPC to OpenVINO Model Server (ovmsclient, local/CPU) or Triton via tritonclient (KServe / GPU path); multi-object tracking with BoxMOT (BoostTrack++); PostgreSQL for app configs, classes, tracks, and observations; MinIO for object storage; LLM chat with LangGraph / LangChain (OpenAI-compatible API) and optional read-only postgres-mcp for SQL tools; optional Arize Phoenix for tracing
  • Frontend (React, React Router, Axios): Dashboard, source selection (RTSP / MP4 thumbnails), configuration page, and chat with Markdown rendering
  • OpenVINO Model Server (OVMS): Model serving runtime; local stack also runs yolo-model-prep (Ultralytics-based export) to build the model repo from app/models/*.pt before OVMS starts
  • MinIO: S3-compatible object storage for models, videos, uploads, and config-related objects
  • PostgreSQL: Durable storage for multi-source configs and tracking data
  • Data loader: Init container that seeds model and video objects into MinIO
  • Label Studio (optional): Annotation UI using the same PostgreSQL and MinIO stack

Storage strategy

All models and video files are stored in MinIO rather than baked into container images:

Deployment Storage method
OpenShift/K8s Files downloaded from MinIO to PVC by init container
Local (Podman) Files downloaded from MinIO at runtime via Python client

Requirements

Minimum hardware expectations

  • KServe / Triton (RUNTIME_TYPE=kserve, e.g. make deploy / make deploy-gpu): plan for GPU-capable worker nodes appropriate to your model-serving footprint; sizing depends on model and cluster policy.
  • OpenVINO Model Server (RUNTIME_TYPE=openvino, e.g. make deploy-openvino): targeted at CPU-oriented model serving—confirm node CPU/memory with your platform team.

Minimum software requirements

  • Podman + podman-compose for local container runs
  • Docker (optional alternative)
  • Helm (for Kubernetes/OpenShift deployment)
  • OpenShift Client CLI (oc) when deploying to or operating against an OpenShift cluster

Required user permissions

  • Project / namespace permissions sufficient to install the Helm release (workloads, routes, PVCs, Services, etc.).
  • Cluster administrator may be required when enabling OpenShift integrations that install SCCs or cluster-scoped bindings—see chart flags such as openshift.scc.enabled, openshift.scc.name, and openshift.roleBinding.*.

Configuration

Copy .env.example to .env and fill in your values. The .env.example file contains the required OpenAI-compatible LLM variables: OPENAI_API_TOKEN, OPENAI_API_ENDPOINT, OPENAI_MODEL, and OPENAI_TEMPERATURE.

Important: When specifying OPENAI_API_ENDPOINT, include /v1 at the end (for example, https://your-api-endpoint.example.com/v1).

OpenShift/Kubernetes make deploy targets run check-openai-env and prompt for any missing OpenAI values, writing them to .env. Local workflows (make local-build-up, make dev-backend) do not run that prompt — create .env yourself before starting the backend so the chat stack can initialize.

Which make deploy variant to use (GPU vs CPU model serving, Label Studio) is covered under DeploySupported model-serving profiles.

Backend environment variables:

  • PORT: backend port (default 8888)
  • FLASK_DEBUG: set to true to enable debug mode
  • CORS_ORIGINS: allowed origins, comma-separated or *

Frontend runtime config (app/frontend/public/env.js or mounted in containers):

  • API_URL: backend base URL (example: http://localhost:8888)

Deploy

The sections below cover cluster deployment (build, push, Helm install) and local workflows. Configure OpenAI-related variables in .env first — see Configuration.

Prerequisites

  • .env populated for OpenAI-compatible chat where used (see Configuration); cluster make deploy targets run check-openai-env interactively if values are missing.
  • Container registry access for make push and make build-push-data as configured in your environment.
  • Requirements satisfied for your target (Helm, oc for OpenShift, etc.).

Supported model-serving profiles

All targets below use the same Helm chart and .env OpenAI settings; they differ only by model-serving runtime (RUNTIME_TYPE) and optional Label Studio.

Makefile target Model serving Label Studio
make deploy or make deploy-gpu KServe / Triton (RUNTIME_TYPE=kserve) off
make deploy-openvino OpenVINO Model Server (RUNTIME_TYPE=openvino) off
make deploy-labelstudio KServe / Triton on
make deploy-openvino-labelstudio OpenVINO Model Server on

Installation steps

  1. Clone this repository to your workstation (use your fork or upstream URL as appropriate).

  2. Configure the application — copy .env.example to .env and set variables as described in Configuration.

  3. Build and push images

# Build backend and frontend images
make build

# Push to registry
make push

# Build and push data loader image (contains model/video for MinIO upload)
make build-push-data
  1. Install on the cluster — pick a profile from Supported model-serving profiles, then run one of:
make deploy NAMESPACE=<your-namespace>
make deploy-openvino NAMESPACE=<your-namespace>
make deploy-labelstudio NAMESPACE=<your-namespace>
make deploy-openvino-labelstudio NAMESPACE=<your-namespace>
  1. Operate and tune — see Deployment workflow, Helm values, and OpenShift-specific chart options below.

Deployment workflow

  1. MinIO starts (from ai-architecture-charts dependency)
  2. Backend Pod Init Container 1 (upload-data): Uploads model/video to MinIO
  3. Backend Pod Init Container 2 (download-data): Downloads files from MinIO to PVC
  4. Backend starts with MINIO_ENABLED=false, reads from PVC paths
  5. Frontend connects to backend API

Helm values

Override settings (from the repository root; chart path matches HELM_CHART in the root Makefile):

export HELM_CHART=$(grep '^HELM_CHART ?=' Makefile | sed 's/^HELM_CHART ?= //')
helm upgrade multimodal-monitoring "$HELM_CHART" \
  --set frontend.apiUrl=/api \
  --set backend.corsOrigins=http://your-frontend-host \
  --set storage.size=2Gi

OpenShift-specific options are included in the chart:

  • Frontend Route: openshift.route.enabled and optional openshift.route.host
  • Backend Route: openshift.backendRoute.enabled and optional openshift.backendRoute.host
  • Label Studio Route: labelStudio.enabled, labelStudio.route.enabled, labelStudio.route.host
  • Shared Route host (same host for frontend + backend): openshift.sharedHost
  • NetworkPolicy: openshift.networkPolicy.enabled
  • SCC/RoleBinding: openshift.scc.enabled, openshift.scc.name, openshift.roleBinding.*

Delete

Remove the deployed application from your cluster:

make undeploy NAMESPACE=<your-namespace>

Local development (Podman Compose)

Build and run

make local-build-up

This starts:

  1. MinIO - Object storage (ports 9000, 9001)
  2. data-loader - Uploads model/video to MinIO (runs once)
  3. backend - Flask API with MINIO_ENABLED=true (port 8888)
  4. frontend - React app (port 3000)
  5. Label Studio - Annotation UI backed by the same PostgreSQL + MinIO stack (port 8082)

Run without rebuild

make local-up

Stop

make local-down

Access

Local development (no containers)

Backend

make dev-backend

Note: Requires model and video files in app/models/ and app/data/ directories.

Frontend

make dev-frontend

Training a custom model

To train a YOLO model for badge detection (or other object classes) using your own images:

  1. Install JupyterLab:

    pip install jupyterlab
    
  2. Run the training notebook:

    cd training
    jupyter lab
    

    Then open yolo_training.ipynb and run the cells in order.

The training/ folder includes an example dataset. See the detailed training README for the full training process, notebook steps, and dataset requirements.

API endpoints

Endpoint Method Description
/api/ GET Health check
/api/video_feed GET MJPEG video stream
/api/latest_info GET Latest description and summary
/api/ask_question POST Question answering based on context
/api/chat POST Rule-based response using detections

Example request

curl -X POST http://localhost:8888/ask_question \
  -H 'Content-Type: application/json' \
  -d '{"question": "How many people are detected?"}'

Reference

Project components

  • BoxMOT - Multi-object tracking library
  • Arize Phoenix - LLM observability and tracing
  • MinIO - S3-compatible object storage
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat Documentation

Legal Notice

Theme

© 2026 Red Hat
Back to top