diff --git a/docs_src/use-cases/order-accuracy/advanced.md b/docs_src/use-cases/order-accuracy/advanced.md
index a9516ca..2f1487d 100644
--- a/docs_src/use-cases/order-accuracy/advanced.md
+++ b/docs_src/use-cases/order-accuracy/advanced.md
@@ -1,144 +1,269 @@
-## Benchmark Quick Start command
-```bash
-make update-submodules
-```
-`update-submodules` ensures all submodules are initialized, updated to their latest remote versions, and ready for use.
+# Advanced Settings
+
+## Configuration Options
+
+### Local Image Building
+
+By default, the application uses pre-built Docker images for faster setup. If you need to build images locally (for customization or development):
```bash
-make benchmark-quickstart
+# Build and run locally instead of using pre-built images
+make build REGISTRY=false
+make up
+
+# Examples for both applications:
+# Dine-In
+cd dine-in && make build REGISTRY=false && make up
+
+# Take-Away
+cd take-away && make build REGISTRY=false && make up
```
-The above command would:
-- Run headless (no display needed: `RENDER_MODE=0`)
-- Pull pre-built images (`REGISTRY=true`)
-- Target GPU by default (`DEVICE_ENV=res/all-gpu.env`)
-- Generate benchmark metrics
-- Run `make consolidate-metrics` automatically
+**When to use local building:**
+- Modifying source code or configurations
+- Development and testing changes
+- Air-gapped environments without internet access
+- Custom hardware optimizations
-## Understanding Benchmarking Types
+**Note**: Local building takes significantly longer (15-30 minutes) compared to pre-built images (2-5 minutes).
-### Default benchmark command
+---
-```bash
-make update-submodules
-```
-`update-submodules` ensures all submodules are initialized, updated to their latest remote versions, and ready for use.
+## Dine-In Configuration
+
+### Environment Configuration (.env)
```bash
-make benchmark
+# =============================================================================
+# Logging
+# =============================================================================
+LOG_LEVEL=INFO
+
+# =============================================================================
+# Service Endpoints
+# =============================================================================
+OVMS_ENDPOINT=http://ovms-vlm:8000
+OVMS_MODEL_NAME=Qwen/Qwen2.5-VL-7B-Instruct
+SEMANTIC_SERVICE_ENDPOINT=http://semantic-service:8080
+API_TIMEOUT=60
```
-Runs with:
-- `RENDER_MODE=0`
-- `REGISTRY=true`
-- `DEVICE_ENV=res/all-cpu.env`
-- `PIPELINE_COUNT=1`
-You can override these values through the following Environment Variables.
+### Test Data Configuration
-| Variable | Description | Values |
-|:----|:----|:---|
-|`RENDER_MODE` | for displaying pipeline and overlay CV metadata | 1, 0 |
-|`REGISTRY` | to pull pre-built images from public registry | false, true |
-|`PIPELINE_COUNT` | number of Loss Prevention Docker container instances to launch | Ex: 1 |
-|`DEVICE_ENV` | path to device specific environment file that will be loaded into the pipeline container | res/all-cpu.env, res/all-gpu.env, res/all-npu.env, res/all-dgpu.env |
+1. **Add Images**: Place food tray/plate images in `images/` folder
+ - Supported formats: `.jpg`, `.jpeg`, `.png`
+ - Images should clearly show food items on the plate
+2. **Update Orders**: Edit `configs/orders.json` with test orders
+ - Each order needs `image_id` and list of `items_ordered`
+ - Image IDs should match filenames (without extension)
+3. **Update Inventory**: Edit `configs/inventory.json` with menu items
+ - Define all possible food items
+ - Include item names, categories, and metadata
-### Benchmark command for GPU
+### Dine-In Docker Services
-```bash
-make DEVICE_ENV=res/all-gpu.env benchmark
-```
+| Container | Ports | Description |
+|-----------|-------|-------------|
+| `dinein_app` | 7861, 8083 | Main application (Gradio + FastAPI) |
+| `dinein_ovms_vlm` | 8002 | Vision-Language Model server |
+| `dinein_semantic_service` | 8081, 9091 | Semantic text matching |
+| `metrics-collector` | 8084 | System metrics aggregation |
-### Benchmark command for NPU
+---
-```bash
-make DEVICE_ENV=res/all-npu.env benchmark
-```
+## Take-Away Configuration
-### Benchmark command to build images locally
+### Environment Configuration (.env)
```bash
-make REGISTRY=false benchmark
+# =============================================================================
+# VLM Backend
+# =============================================================================
+VLM_BACKEND=ovms
+OVMS_ENDPOINT=http://ovms-vlm:8000
+OVMS_MODEL_NAME=Qwen/Qwen2.5-VL-7B-Instruct
+OPENVINO_DEVICE=GPU # 'GPU', 'CPU', or 'AUTO'
+
+# =============================================================================
+# Semantic Service
+# =============================================================================
+SEMANTIC_VLM_BACKEND=ovms
+DEFAULT_MATCHING_STRATEGY=hybrid # 'exact', 'semantic', or 'hybrid'
+SIMILARITY_THRESHOLD=0.85
+OVMS_TIMEOUT=60
+
+# =============================================================================
+# MinIO Storage
+# =============================================================================
+MINIO_ROOT_USER=minioadmin
+MINIO_ROOT_PASSWORD=minioadmin
+MINIO_ENDPOINT=minio:9000
```
-## See the benchmarking results.
+### Service Modes
-```sh
-make consolidate-metrics
-
-cat benchmark/metrics.csv
-```
+| Mode | Configuration | Use Case |
+|------|---------------|----------|
+| **Single** | `SERVICE_MODE=single` | Development, testing |
+| **Parallel** | `SERVICE_MODE=parallel WORKERS=4` | Production deployment |
+**Start in Different Modes:**
+```bash
+# Single mode (default)
+make up
+# Parallel mode with 4 workers
+make up-parallel WORKERS=4
+# Parallel mode with auto-scaling
+make up-parallel WORKERS=4 SCALING_MODE=auto
+```
+### Take-Away Docker Services
-## Benchmark Stream Density
+| Container | Ports | Description |
+|-----------|-------|-------------|
+| `takeaway_app` | 7860, 8080 | Main application (Gradio + FastAPI) |
+| `ovms-vlm` | 8001 | Vision-Language Model server |
+| `frame-selector` | 8085 | YOLO-based frame selection |
+| `semantic-service` | 8081, 9091 | Semantic text matching |
+| `minio` | 9000, 9001 | S3-compatible storage |
-To test the maximum amount of Order Accuracy containers/pipelines that can run on a given system you can use the TARGET_FPS environment variable. Default is to find the container threshold over 7.95 FPS with the run-pipeline.sh pipeline. You can override these values through Environment Variables.
+---
-List of EVs:
+## Benchmarking
- | Variable | Description | Values |
- |:----|:----|:---|
- |`TARGET_FPS` | threshold value for FPS to consider a valid stream | Ex. 7.95 |
- |`OOM_PROTECTION` | flag to enable/disable OOM checks before scaling the pipeline (enabled by default) | 1, 0 |
+### Dine-In Benchmarking
-> **Note:**
->
-> An OOM crash occurs when a system or application tries to use more memory (RAM) than is available, causing the operating system to forcibly terminate processes to free up memory.
-> If `OOM_PROTECTION` is set to 0, the system may crash or become unresponsive, requiring a hard reboot.
-
+**Initialize Performance Tools:**
```bash
-make benchmark-stream-density
+cd dine-in
+make update-submodules
```
-You can check the output results for performance metrics in the `results` folder at the root level. Also, the stream density script will output the results in the console:
+**Run Benchmark:**
+```bash
+make benchmark
+```
+**Stream Density Test:**
+```bash
+make benchmark-density
+```
+**View Results:**
+```bash
+make benchmark-density-results
+cat results/benchmark_results.json
+```
-### Change the Target FPS value:
+### Take-Away Benchmarking
+**Initialize Performance Tools:**
```bash
-make TARGET_FPS=6.5 benchmark-stream-density
+cd take-away
+make update-submodules
```
+**Single Video Benchmark:**
+```bash
+make benchmark
+```
-Alternatively you can directly call the benchmark.py. This enables you to take advantage of all performance tools parameters. More details about the performance tools can be found [HERE](../../performance-tools/benchmark.md#benchmark-stream-density-for-cv-pipelines)
+**Fixed Workers Benchmark:**
+```bash
+make benchmark-oa BENCHMARK_WORKERS=4 BENCHMARK_DURATION=300
+```
+**Stream Density Benchmark:**
```bash
-cd performance-tools/benchmark-scripts && python benchmark.py --compose_file ../../src/docker-compose.yml --target_fps 7
+make benchmark-stream-density \
+ BENCHMARK_TARGET_LATENCY_MS=25000 \
+ BENCHMARK_MIN_TRANSACTIONS=3 \
+ BENCHMARK_WORKER_INCREMENT=1
```
+### Benchmark Configuration Variables
+| Variable | Default | Description |
+|----------|---------|-------------|
+| `TARGET_LATENCY_MS` | 25000 | Target latency threshold (ms) |
+| `LATENCY_METRIC` | avg | 'avg', 'p95', or 'max' |
+| `WORKER_INCREMENT` | 1 | Workers added per iteration |
+| `INIT_DURATION` | 10 | Warmup time (seconds) |
+| `MIN_TRANSACTIONS` | 3 | Min transactions before measuring |
+| `MAX_ITERATIONS` | 50 | Max scaling iterations |
+| `RESULTS_DIR` | ./results | Results output directory |
+---
+## System Requirements
+### Minimum Configuration
+| Component | Specification |
+|-----------|---------------|
+| CPU | Intel Xeon 8+ cores |
+| RAM | 16 GB |
+| GPU | Intel Arc A770 8GB / NVIDIA RTX 3060 |
+| Storage | 50 GB SSD |
+| Docker | 24.0+ with Compose V2 |
-## ๐ ๏ธ Other Useful Make Commands.
+### Recommended Configuration
-- `make clean-images` โ Remove dangling Docker images
-- `make clean-models` โ Remove all the downloaded models from the system
-- `make clean-all` โ Remove all unused Docker resources
+| Component | Specification |
+|-----------|---------------|
+| CPU | Intel Xeon 16+ cores |
+| RAM | 32 GB |
+| GPU | NVIDIA RTX 3080+ / Intel Data Center GPU |
+| Storage | 200 GB NVMe SSD |
+| Network | 10 Gbps (for Take-Away RTSP) |
-## ๐ Project Structure
+---
-- `configs/` โ Configuration files (workload videos URLs)
-- `docker/` โ Dockerfiles for downloader and pipeline containers
-- `download-scripts/` โ Scripts for downloading models and videos
-- `src/` โ Main source code and pipeline runner scripts
-- `Makefile` โ Build automation and workflow commands
+## Useful Make Commands
----
+### Dine-In Commands
+```bash
+make build # Build Docker images
+make up # Start services
+make down # Stop services
+make logs # View logs
+make update-submodules # Initialize performance-tools
+make benchmark # Run benchmark
+make benchmark-density # Run stream density test
+```
-## Configure the system proxy
+### Take-Away Commands
-Please follow the below steps to configure the proxy
+```bash
+make build # Build Docker images
+make up # Start (single mode)
+make up-parallel WORKERS=4 # Start (parallel mode)
+make down # Stop services
+make logs # View logs
+make update-submodules # Initialize performance-tools
+make benchmark # Run benchmark
+make benchmark-stream-density # Stream density test
+```
-### 1. Configure Proxy for the Current Shell Session
+### Common Commands
+
+- `make clean-images` โ Remove dangling Docker images
+- `make clean-all` โ Remove all unused Docker resources
+- `make check-env` โ Verify configuration
+- `make show-config` โ Display current configuration
+
+---
+
+## Configure System Proxy
+
+Please follow these steps to configure proxy settings:
+
+### 1. Configure Proxy for Current Shell Session
```bash
export http_proxy=http://:
@@ -147,60 +272,63 @@ export HTTP_PROXY=http://:
export HTTPS_PROXY=http://:
export NO_PROXY=localhost,127.0.0.1,::1
export no_proxy=localhost,127.0.0.1,::1
-export socks_proxy=http://:
-export SOCKS_PROXY=http://:
```
-### 2. System-Wide Proxy Configuration
-
-System-wide environment (/etc/environment)
-(Run: sudo nano /etc/environment and add or update)
+### 2. Docker Daemon Proxy Configuration
+Create directory if missing:
```bash
-http_proxy=http://:
-https_proxy=http://:
-ftp_proxy=http://:
-socks_proxy=http://:
-no_proxy=localhost,127.0.0.1,::1
-
-HTTP_PROXY=http://:
-HTTPS_PROXY=http://:
-FTP_PROXY=http://:
-SOCKS_PROXY=http://:
-NO_PROXY=localhost,127.0.0.1,::1
-```
-### 3. Docker Daemon & Client Proxy Configuration
-
-Docker daemon drop-in (/etc/systemd/system/docker.service.d/http-proxy.conf)
-Create dir if missing:
sudo mkdir -p /etc/systemd/system/docker.service.d
sudo nano /etc/systemd/system/docker.service.d/http-proxy.conf
+```
-```bash
+Add configuration:
+```ini
[Service]
Environment="http_proxy=http://:"
Environment="https_proxy=http://:"
Environment="no_proxy=localhost,127.0.0.1,::1"
-Environment="HTTP_PROXY=http://:"
-Environment="HTTPS_PROXY=http://:"
-Environment="NO_PROXY=localhost,127.0.0.1,::1"
-Environment="socks_proxy=http://:"
-Environment="SOCKS_PROXY=http://:"
+```
-# Reload & restart:
+Reload and restart:
+```bash
sudo systemctl daemon-reload
sudo systemctl restart docker
+```
+
+---
+
+## Troubleshooting
+
+### Common Issues
-# Docker client config (~/.docker/config.json)
-# mkdir -p ~/.docker
-# nano ~/.docker/config.json
-{
- "proxies": {
- "default": {
- "httpProxy": "http://:",
- "httpsProxy": "http://:",
- "noProxy": "localhost,127.0.0.1,::1"
- }
- }
-}
-```
\ No newline at end of file
+**OVMS Not Loading:**
+- Ensure GPU drivers are installed
+- Check model files exist in `ovms-service/models/`
+- Verify OVMS endpoint in `.env`
+
+**VLM Timeout Errors:**
+- Increase `API_TIMEOUT` in `.env`
+- Check GPU memory utilization
+- Consider using a smaller model precision (INT8)
+
+**Stream Processing Issues (Take-Away):**
+- Verify RTSP stream URLs are accessible
+- Check network bandwidth
+- Consider reducing number of parallel workers
+
+### Debug Commands
+
+```bash
+# Check container logs
+docker logs
+
+# Check GPU utilization
+nvidia-smi -l 1
+
+# Check network connectivity
+curl http://localhost:8001/v2/models
+
+# Verify service health
+curl http://localhost:8083/health
+```
diff --git a/docs_src/use-cases/order-accuracy/architecture.md b/docs_src/use-cases/order-accuracy/architecture.md
new file mode 100644
index 0000000..9d725b1
--- /dev/null
+++ b/docs_src/use-cases/order-accuracy/architecture.md
@@ -0,0 +1,356 @@
+# Order Accuracy System Architecture
+
+## Table of Contents
+1. [System Overview](#system-overview)
+2. [Architecture Diagrams](#architecture-diagrams)
+3. [Component Details](#component-details)
+4. [Data Flow](#data-flow)
+5. [Production Features](#production-features)
+
+## System Overview
+
+The Order Accuracy platform is an enterprise AI vision system designed for real-time order validation in quick-service restaurant (QSR) environments. The system uses Vision Language Models (VLM) to analyze images or video feeds, automatically identifying items and validating them against order data.
+
+### Key Features
+- **VLM-Powered Detection**: Uses Qwen2.5-VL-7B for accurate item identification
+- **Intel Hardware Optimization**: Optimized for Intel CPUs and GPUs via OpenVINO
+- **Dual Application Support**: Dine-In (image-based) and Take-Away (video stream-based)
+- **Semantic Matching**: Fuzzy matching for item name variations
+- **Real-time Processing**: Sub-15-second validation for operational efficiency
+- **Containerized Deployment**: Docker-based deployment with microservices architecture
+
+## Architecture Diagrams
+
+### Platform Architecture
+
+```mermaid
+graph TB
+ subgraph "Order Accuracy Platform"
+ subgraph "Dine-In Application"
+ DUI[Gradio UI :7861]
+ DAPI[FastAPI API :8083]
+ DVLM[VLM Client]
+ DSEM[Semantic Client]
+ end
+
+ subgraph "Take-Away Application"
+ TUI[Gradio UI :7860]
+ TAPI[FastAPI API :8080]
+ TSW[Station Workers]
+ TVS[VLM Scheduler]
+ TFS[Frame Selector]
+ end
+
+ subgraph "Shared Services"
+ OVMS[OVMS VLM
Qwen2.5-VL-7B]
+ SEM[Semantic Service]
+ MINIO[MinIO Storage]
+ end
+ end
+
+ DUI --> DAPI
+ DAPI --> DVLM
+ DAPI --> DSEM
+ DVLM --> OVMS
+ DSEM --> SEM
+
+ TUI --> TAPI
+ TAPI --> TSW
+ TSW --> TFS
+ TSW --> TVS
+ TVS --> OVMS
+ TFS --> MINIO
+```
+
+### Dine-In Architecture
+
+```
+โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
+โ DINE-IN ORDER ACCURACY โ
+โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
+โ โ
+โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ โ
+โ โ โ โ โ โ โ โ
+โ โ Gradio UI โโโโโโโถโ FastAPI API โโโโโโโถโ Validation โ โ
+โ โ (Port 7861)โ โ (Port 8083) โ โ Service โ โ
+โ โ โ โ โ โ โ โ
+โ โโโโโโโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโโ โโโโโโโโโโโโฌโโโโโโโโโโโ โ
+โ โ โ โ
+โ โโโโโโโโโโโโโดโโโโโโโโโโโโ โ โ
+โ โ โ โ โ
+โ โผ โผ โผ โ
+โ โโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโ โ
+โ โ VLM Client โ โ Semantic Client โ โ Metrics โ โ
+โ โ (Circuit โ โ (Circuit โ โ Collector โ โ
+โ โ Breaker) โ โ Breaker) โ โ โ โ
+โ โโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโโโโโโโโ โ
+โ โ โ โ
+โโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
+ โ โ
+ โผ โผ
+ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
+ โ OVMS VLM โ โ Semantic โ
+ โ (Qwen2.5-VL) โ โ Service โ
+ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
+```
+
+### Take-Away Architecture
+
+```
+โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
+โ TAKE-AWAY ORDER ACCURACY SYSTEM โ
+โ โ
+โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
+โ โ RTSP Video โ โ Frame Selector โ โ Order โ โ
+โ โ Streams โโโโโถโ Service โโโโโถโ Accuracy โ โ
+โ โ (GStreamer) โ โ (YOLO) โ โ Service โ โ
+โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโ โ
+โ โ โ
+โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค โ
+โ โ โ โ
+โ โผ โผ โ
+โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
+โ โ VLM Scheduler โ โ Validation โ โ
+โ โ (Batcher) โ โ Agent โ โ
+โ โโโโโโโโโโฌโโโโโโโโโ โโโโโโโโโโฌโโโโโโโโโ โ
+โ โ โ โ
+โ โผ โผ โ
+โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
+โ โ OVMS VLM โ โ Semantic โ โ
+โ โ (Qwen2.5-VL) โ โ Service โ โ
+โ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โ
+โ โ
+โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
+```
+
+## Component Details
+
+### Core Components
+
+#### 1. VLM Backend (OVMS)
+
+OpenVINO Model Server hosting Qwen2.5-VL-7B for vision-language inference.
+
+**Features:**
+- OpenAI-compatible API (`/v3/chat/completions`)
+- INT8 quantization for optimized performance
+- GPU acceleration via Intel/NVIDIA hardware
+- Shared model instance for both applications
+
+**API Usage:**
+```python
+response = requests.post(
+ f"{OVMS_ENDPOINT}/v3/chat/completions",
+ json={
+ "model": "Qwen/Qwen2.5-VL-7B-Instruct",
+ "messages": [
+ {
+ "role": "user",
+ "content": [
+ {"type": "text", "text": prompt},
+ {"type": "image_url", "image_url": {"url": f"data:image/jpeg;base64,{img_b64}"}}
+ ]
+ }
+ ]
+ }
+)
+```
+
+#### 2. Semantic Comparison Service
+
+AI-powered semantic matching microservice for intelligent item comparison.
+
+**Matching Strategies:**
+- **Exact**: Direct string comparison
+- **Semantic**: Vector similarity using sentence-transformers
+- **Hybrid**: Exact first, then semantic fallback
+
+**Example Matches:**
+- "Big Mac" โ "Maharaja Mac" (regional name variant)
+- "green apple" โ "apple" (partial match)
+- "large fries" โ "french fries large" (word reordering)
+
+#### 3. Frame Selector Service (Take-Away)
+
+YOLO-based intelligent frame selection for optimal VLM input.
+
+**Process:**
+1. Receive raw video frames from GStreamer pipeline
+2. Run YOLO object detection on each frame
+3. Score frames by item visibility and clarity
+4. Select top K frames per order
+5. Store selected frames in MinIO
+
+#### 4. VLM Scheduler (Take-Away)
+
+Request batching scheduler optimizing OVMS throughput.
+
+**Batching Strategy:**
+- Time Window: 50-100ms collection period
+- Max Batch Size: Configurable (default: 16)
+- Fair Scheduling: Round-robin across workers
+- Response Routing: Match responses to original requesters
+
+### Docker Services
+
+#### Dine-In Services
+
+| Container | Ports | Description |
+|-----------|-------|-------------|
+| `dinein_app` | 7861, 8083 | Main application (Gradio + FastAPI) |
+| `dinein_ovms_vlm` | 8002 | Vision-Language Model server |
+| `dinein_semantic_service` | 8081 | Semantic text matching |
+| `metrics-collector` | 8084 | System metrics aggregation |
+
+#### Take-Away Services
+
+| Container | Ports | Description |
+|-----------|-------|-------------|
+| `takeaway_app` | 7860, 8080 | Main application (Gradio + FastAPI) |
+| `ovms-vlm` | 8001 | Vision-Language Model server |
+| `frame-selector` | 8085 | YOLO-based frame selection |
+| `semantic-service` | 8081 | Semantic text matching |
+| `minio` | 9000, 9001 | S3-compatible storage |
+| `rtsp-streamer` | 8554 | RTSP stream simulator (testing) |
+
+## Data Flow
+
+### Dine-In Validation Pipeline
+
+```
+โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
+โ VALIDATION PIPELINE โ
+โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
+โ โ
+โ 1. IMAGE PREPROCESSING โ
+โ Raw Image โ Auto-Orient โ Resize (672px) โ Enhance โ โ
+โ Sharpen โ JPEG Compress (82%) โ Base64 Encode โ
+โ โ โ
+โ โผ โ
+โ 2. VLM INFERENCE โ
+โ Prompt: "Analyze this food plate image..." โ
+โ + Inventory list for context โ
+โ โ OVMS POST /v3/chat/completions โ
+โ โ Parse JSON response for detected items โ
+โ โ โ
+โ โผ โ
+โ 3. SEMANTIC MATCHING โ
+โ For each expected item: โ
+โ Find best match in detected items (similarity > 0.7) โ
+โ Track: matched, missing, extra, quantity mismatches โ
+โ โ โ
+โ โผ โ
+โ 4. RESULT AGGREGATION โ
+โ { โ
+โ "order_complete": true/false, โ
+โ "accuracy_score": 0.0-1.0, โ
+โ "missing_items": [...], โ
+โ "extra_items": [...] โ
+โ } โ
+โ โ
+โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
+```
+
+### Take-Away Processing Pipeline
+
+```
+โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
+โ DATA FLOW PIPELINE โ
+โ โ
+โ 1. VIDEO CAPTURE โ
+โ RTSP Camera โโโถ GStreamer Pipeline โโโถ Frame Buffer โ
+โ โ
+โ 2. FRAME SELECTION โ
+โ Frame Selector (YOLO): โ
+โ โข Object detection on raw frames โ
+โ โข Score frames by item visibility โ
+โ โข Select top K frames per order โ
+โ โข Store selected frames in MinIO โ
+โ โ
+โ 3. VLM PROCESSING โ
+โ VLM Scheduler โ OVMS (Qwen2.5-VL): โ
+โ โข Batch frames by time window โ
+โ โข Send to OVMS with detection prompt โ
+โ โข Parse structured item response โ
+โ โ
+โ 4. ORDER VALIDATION โ
+โ Validation Agent: โ
+โ โข Compare detected items with expected order โ
+โ โข Exact match โ Semantic match โ Flag mismatch โ
+โ โข Generate validation result โ
+โ โ
+โ 5. RESULT OUTPUT โ
+โ { "matched": [...], "missing": [...], "extra": [...] } โ
+โ โ
+โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
+```
+
+## Production Features
+
+### Circuit Breaker Pattern
+
+Prevents cascading failures when external services are unhealthy.
+
+```
+ 5 consecutive failures
+ โโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโถ โโโโโโโโโโ
+ โ โ โ โ
+ โ CLOSED โ โ OPEN โ
+ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
+ โโโโโโโโโโ 2 successes in half_open โโโโโโโโโโ
+ โฒ โ
+ โ โ
+ โ โโโโโโโโโโโโโโ โ
+ โโโโโโโโโโ HALF_OPEN โโโโโโโโโโโโโโโโโโโ
+ 2 successes โโโโโโโโโโโโโโ 30s timeout
+ โ
+ โ 1 failure โ Back to OPEN
+```
+
+**Configuration:**
+- VLM Client: 5 failures โ OPEN, 30s recovery โ HALF_OPEN
+- Semantic Client: 15s recovery timeout (faster than VLM)
+
+### Connection Pooling
+
+```python
+# VLM Client Pool Configuration
+limits = httpx.Limits(
+ max_keepalive_connections=20,
+ max_connections=50,
+ keepalive_expiry=30.0
+)
+timeout = httpx.Timeout(
+ connect=10.0,
+ read=300.0, # Extended for VLM inference
+ write=10.0,
+ pool=10.0
+)
+```
+
+### Bounded Cache (LRU)
+
+Thread-safe LRU cache with automatic eviction to prevent memory exhaustion:
+- Maximum 10,000 entries
+- Automatic eviction of oldest entries when full
+- Thread-safe operations with locking
+
+### Station Worker Reliability (Take-Away)
+
+| Feature | Implementation |
+|---------|----------------|
+| GStreamer Pipeline | RTSP โ H.264 decode โ Frame capture |
+| Circuit Breaker | 5 failures in 5 min โ 30s cooldown |
+| Exponential Backoff | 2s โ 4s โ 8s โ ... โ 60s max |
+| Stall Detection | No frames for 5 min triggers restart |
+| Health Monitoring | Frame rate, pipeline state tracking |
+
+### Performance Characteristics
+
+| Metric | Dine-In | Take-Away |
+|--------|---------|-----------|
+| **End-to-End Latency** | 8-15 seconds | Real-time stream |
+| **VLM Inference** | 5-10 seconds | 5-10 seconds (batched) |
+| **Semantic Matching** | 50-200ms | 50-200ms |
+| **Throughput** | ~4-6 req/min | Multiple concurrent streams |
+| **GPU Utilization** | 60-80% | 70-90% (parallel mode) |
diff --git a/docs_src/use-cases/order-accuracy/getting_started.md b/docs_src/use-cases/order-accuracy/getting_started.md
index 97fc173..d062f31 100644
--- a/docs_src/use-cases/order-accuracy/getting_started.md
+++ b/docs_src/use-cases/order-accuracy/getting_started.md
@@ -1,117 +1,193 @@
# Getting Started
-### **NOTE:**
+## ๐ Prerequisites
-By default the application runs by pulling the pre-built images. If you want to build the images locally and then run the application, set the flag:
+- Ubuntu 24.04 or newer (Linux recommended), Desktop edition (or Server edition with GUI installed)
+- [Docker](https://docs.docker.com/engine/install/) 24.0+
+- [Docker Compose](https://docs.docker.com/compose/install/) V2+
+- [Make](https://www.gnu.org/software/make/) (`sudo apt install make`)
+- Intel hardware (CPU, iGPU, dGPU)
+- Intel drivers:
+ - [Intel GPU drivers](https://dgpu-docs.intel.com/driver/client/overview.html)
+- Sufficient disk space for models, videos, and results (50GB minimum)
-```bash
-REGISTRY=false
+!!! note
+ First-time setup downloads AI models (~7GB) and Docker images - this may take 30-60 minutes depending on your internet connection.
-usage: make REGISTRY=false (applicable for all commands like benchmark, benchmark-stream-density..)
-Example: make run-demo REGISTRY=false
-```
+## Choose Your Application
-(If this is the first time, it will take some time to download videos, models, docker images and build images)
+### ๐ฝ๏ธ Dine-In Order Accuracy
+**Purpose**: Validate food plates at serving stations before delivery to tables
+**Use When**: You need image-based validation for restaurant table service
+**Input**: Static images of food trays/plates
+**Features**: Gradio web interface, REST API for POS integration
-## Step by step instructions:
+### ๐ฅก Take-Away Order Accuracy
+**Purpose**: Real-time order validation for drive-through and counter service
+**Use When**: You need continuous video stream validation at multiple stations
+**Input**: RTSP video streams
+**Features**: Multi-station parallel processing, VLM request batching
-1. Download the models using download_models/downloadModels.sh
+## Quick Start Reference
- ```bash
- make download-models
- ```
+### ๐ฝ๏ธ Dine-In Quick Commands
-2. Update github submodules
+| Configuration | Command | Description |
+|---------------|---------|-------------|
+| **Start Services** | `make up` | Start all dine-in services |
+| **Build Locally** | `make build REGISTRY=false` | Build images from source |
+| **View Logs** | `make logs` | View service logs |
+| **Stop Services** | `make down` | Stop all containers |
- ```bash
- make update-submodules
- ```
+### ๐ฅก Take-Away Quick Commands
-3. Download sample videos used by the performance tools
+| Configuration | Command | Description |
+|---------------|---------|-------------|
+| **Single Mode** | `make up` | Start in single worker mode (development) |
+| **Parallel Mode** | `make up-parallel WORKERS=4` | Start with 4 parallel workers (production) |
+| **Build Locally** | `make build REGISTRY=false` | Build images from source |
+| **View Logs** | `make logs` | View service logs |
- ```bash
- make download-sample-videos
- ```
+!!! tip
+ **Single Mode** is best for development and testing. **Parallel Mode** is recommended for production with multiple camera stations.
+
+## Step-by-Step Instructions
-4. Run the order accuracy application
+### Option 1: Dine-In Order Accuracy
+1. **Clone the Repository**
```bash
- make run-render-mode
+ git clone -b --single-branch https://github.com/intel-retail/order-accuracy
```
-
-- The above series of commands can be executed using only one command:
-
- ```bash
- make run-demo
- ```
-
-5. To build the images locally step by step:
-- Follow the following steps:
- ```bash
- make download-models REGISTRY=false
- make update-submodules REGISTRY=false
- make download-sample-videos
- make run-render-mode REGISTRY=false
- ```
-- The above series of commands can be executed using only one command:
+ >Replace `` with the version you want to clone (for example, **v2026.0**).
```bash
- make run-demo REGISTRY=false
+ git clone -b v2026.0 --single-branch https://github.com/intel-retail/order-accuracy
+ cd order-accuracy/dine-in
```
-6. Verify Docker containers
-
+2. **Setup OVMS Models (First Time Only)**
```bash
- docker ps --all
+ cd ../ovms-service
+ ./setup_models.sh
+ cd ../dine-in
```
- Result:
+ This downloads and converts the Qwen2.5-VL-7B model (~7GB). This only needs to be done once.
+
+3. **Prepare Test Data**
+ - Add your food tray/plate images to the `images/` folder
+ - Update `configs/orders.json` with test orders
+ - Update `configs/inventory.json` with your menu items
+
+4. **Build and Start Services**
```bash
- NAMES STATUS IMAGE
- src-ClientGst-1 Up 17 seconds (healthy) dlstreamer:dev
- model-downloader Exited(0) 17 seconds model-downloader:latest
+ # Using pre-built images (recommended for first run)
+ make build
+ make up
+
+ # OR build locally from source
+ make build REGISTRY=false
+ make up
```
-7. Verify Results
+5. **Access the Application**
+ - **Gradio UI**: http://localhost:7861
+ - **REST API Docs**: http://localhost:8083/docs
- After starting Order Accuracy you will begin to see result files being written into the results/ directory. Here are example outputs from the 3 log files.
+---
- gst-launch_