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.
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 Copy linkLink copied!
Monitor workplace safety and operational compliance in real time using AI object detection, multimodal analysis, and conversational insights.
Table of Contents Copy linkLink copied!
- Detailed description
- Requirements
- Configuration
- Deploy
- Training a custom model
- API endpoints
- Reference
- Tags
Detailed description Copy linkLink copied!
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.

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 Copy linkLink copied!
Architecture diagrams Copy linkLink copied!
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 Copy linkLink copied!
Application workflow Copy linkLink copied!
Components Copy linkLink copied!
- Backend (Flask, OpenCV): Video decode, MJPEG output, and drawn overlays; inference over gRPC to OpenVINO Model Server (
ovmsclient, local/CPU) or Triton viatritonclient(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/*.ptbefore 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 Copy linkLink copied!
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 Copy linkLink copied!
Minimum hardware expectations Copy linkLink copied!
- 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 Copy linkLink copied!
- Podman +
podman-composefor 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 Copy linkLink copied!
- 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, andopenshift.roleBinding.*.
Configuration Copy linkLink copied!
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 Deploy → Supported model-serving profiles.
Backend environment variables:
PORT: backend port (default8888)FLASK_DEBUG: set totrueto enable debug modeCORS_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 Copy linkLink copied!
The sections below cover cluster deployment (build, push, Helm install) and local workflows. Configure OpenAI-related variables in .env first — see Configuration.
Prerequisites Copy linkLink copied!
.envpopulated for OpenAI-compatible chat where used (see Configuration); clustermake deploytargets runcheck-openai-envinteractively if values are missing.- Container registry access for
make pushandmake build-push-dataas configured in your environment. - Requirements satisfied for your target (Helm,
ocfor OpenShift, etc.).
Supported model-serving profiles Copy linkLink copied!
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 Copy linkLink copied!
Clone this repository to your workstation (use your fork or upstream URL as appropriate).
Configure the application — copy
.env.exampleto.envand set variables as described in Configuration.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
- 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>
- Operate and tune — see Deployment workflow, Helm values, and OpenShift-specific chart options below.
Deployment workflow Copy linkLink copied!
- MinIO starts (from
ai-architecture-chartsdependency) - Backend Pod Init Container 1 (
upload-data): Uploads model/video to MinIO - Backend Pod Init Container 2 (
download-data): Downloads files from MinIO to PVC - Backend starts with
MINIO_ENABLED=false, reads from PVC paths - Frontend connects to backend API
Helm values Copy linkLink copied!
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.enabledand optionalopenshift.route.host - Backend Route:
openshift.backendRoute.enabledand optionalopenshift.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 Copy linkLink copied!
Remove the deployed application from your cluster:
make undeploy NAMESPACE=<your-namespace>
Local development (Podman Compose) Copy linkLink copied!
Build and run Copy linkLink copied!
make local-build-up
This starts:
- MinIO - Object storage (ports 9000, 9001)
- data-loader - Uploads model/video to MinIO (runs once)
- backend - Flask API with
MINIO_ENABLED=true(port 8888) - frontend - React app (port 3000)
- Label Studio - Annotation UI backed by the same PostgreSQL + MinIO stack (port 8082)
Run without rebuild Copy linkLink copied!
make local-up
Stop Copy linkLink copied!
make local-down
Access Copy linkLink copied!
- Frontend: http://localhost:3000
- Backend API: http://localhost:8888/api/
- MinIO Console: http://localhost:9001 (login:
minioadmin/minioadmin) - Label Studio: http://localhost:8082
Local development (no containers) Copy linkLink copied!
Backend Copy linkLink copied!
make dev-backend
Note: Requires model and video files in app/models/ and app/data/ directories.
Frontend Copy linkLink copied!
make dev-frontend
Training a custom model Copy linkLink copied!
To train a YOLO model for badge detection (or other object classes) using your own images:
Install JupyterLab:
pip install jupyterlabRun the training notebook:
cd training jupyter labThen open
yolo_training.ipynband 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 Copy linkLink copied!
| 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 Copy linkLink copied!
curl -X POST http://localhost:8888/ask_question \
-H 'Content-Type: application/json' \
-d '{"question": "How many people are detected?"}'
Reference Copy linkLink copied!
Related resources Copy linkLink copied!
- Ultralytics YOLO - Object detection model framework
- OpenVINO Model Server - Model serving runtime documentation
- KServe - Kubernetes-based model serving platform
- Label Studio - Data annotation and labeling tool
- LangGraph - Framework for building stateful LLM applications
Project components Copy linkLink copied!
- BoxMOT - Multi-object tracking library
- Arize Phoenix - LLM observability and tracing
- MinIO - S3-compatible object storage

