Skip to content

Commit 81e23e4

Browse files
authored
feat: integrate retail ai suite of loss prevention within edge ai demo studio (#1044) (#601)
1 parent d9f5793 commit 81e23e4

293 files changed

Lines changed: 16540 additions & 3706 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

samples/ai/edge-ai-demo-studio/README.md

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,35 @@ Edge AI Demo Studio is a modern toolkit for deploying, managing, and serving AI
1313
- **Web-Based Management:** Manage devices, workloads, and users through a modern web interface.
1414
- **Edge Optimized:** Built for Intel hardware and edge environments.
1515
- **AI Services:** AI Services that users can use for their applications
16-
- Text Generation (LLM)
17-
- Text to Speech (TTS)
18-
- Speech to Text (STT)
19-
- Embedding
20-
- Lipsync
21-
- Image Generation
22-
- MCP Manager
23-
- Wake Word Detection
24-
- **Samples:** Samples use cases that implements the ai services
25-
- Digital Avatar
26-
- RAG Chat
27-
- [AI Exam Marking](./frontend/src/samples/ai-exam-marking/README.md)
16+
- **Text Generation** — Generate coherent text using large language models optimized for Intel hardware.
17+
- **Text to Speech** — Natural-sounding speech synthesis with multiple voice options powered by Kokoro TTS.
18+
- **Speech to Text** — Real-time speech recognition with low-latency transcription using Whisper models optimized for Intel hardware.
19+
- **Speaker Diarization** — Identify and label speakers in audio recordings using pyannote.audio speaker diarization models.
20+
- **Text Embedding** — Generate dense vector embeddings for semantic search and RAG pipelines.
21+
- **Reranker** — Rescore and rerank documents by relevance for improved search and RAG pipelines.
22+
- **Vector Database** — FAISS-based vector storage for knowledge base management, semantic search, and RAG pipelines.
23+
- **Lipsync** — Real-time avatar lip-syncing with Wav2Lip, streamed over WebRTC.
24+
- **Image Generation** — Generate images from text prompts using diffusion models accelerated with OpenVINO.
25+
- **MCP Manager** — Manage Model Context Protocol servers and their tool integrations.
26+
- **Wake Word Detection** — Detect custom wake words from microphone input and send webhook notifications on detection events.
27+
- **Samples:** Sample use cases that implement the AI services
28+
- **Digital Avatar** — Interact with an AI-powered avatar that combines real-time video with intelligent conversation.
29+
- **Digital Avatar Lite** — A lightweight animated robot avatar that brings conversations to life with responsive movements and expressions.
30+
- **RAG Chatbot** — Upload documents and chat with an AI that retrieves relevant context to answer your questions.
31+
- **Medical Scribe** — Automatically transcribe and diarize doctor-patient conversations, then generate structured SOAP notes.
32+
- **Webcam Capture with VLM** — Demonstrate the integration of webcam capture and Visual Language Model (VLM) for enhanced interaction.
33+
- **[AI Exam Marking](./frontend/src/samples/ai-exam-marking/README.md)** — AI-powered exam marking using OCR and LLM to automatically grade test papers from images.
34+
- **PowerPoint Translator** — Translate PowerPoint presentations while preserving formatting using AI.
35+
- **[Geti Image Classification](./frontend/src/samples/geti-classifier/README.md)** — Classify images using a local Intel Geti deployment and send feedback for continuous model improvement.
36+
- **Synthetic Image Generation** — Generate and edit synthetic images from base images in real-time for dataset augmentation.
37+
- **Robotics AI** — A demo showcasing the capabilities of Robotics AI, including real-time object detection and manipulation.
38+
- **Suites:** Curated industry-specific AI solution packages built on Intel Edge AI Suites
39+
- [*Manufacturing AI Suite*](https://github.com/open-edge-platform/edge-ai-suites/tree/main/manufacturing-ai-suite) — A comprehensive toolkit for building, deploying, and scaling AI applications in industrial environments. Enables real-time integration with optimized hardware for production workflow automation, workplace safety, defect detection, and asset tracking.
40+
- [**Pallet Defect Detection**](https://github.com/open-edge-platform/edge-ai-suites/tree/main/manufacturing-ai-suite/industrial-edge-insights-vision) — Real-time pallet condition monitoring on warehouse video streams using DL Streamer Pipeline Server, OpenVINO inference, and WebRTC streaming.
41+
- [*Metro AI Suite*](https://github.com/open-edge-platform/edge-ai-suites/tree/main/metro-ai-suite) — Accelerates application development for edge AI video safety, security, and smart city use cases. Includes OpenVINO™ toolkit, Deep Learning Streamer, and Intel® oneAPI Toolkit for media analytics and AI performance optimization.
42+
- [**Image-Based Video Search**](https://github.com/open-edge-platform/edge-ai-suites/tree/main/metro-ai-suite/image-based-video-search) — Near real-time image-based similarity search over live video streams using YOLOv11 object detection, ResNet-50 feature extraction via DL Streamer, and Milvus vector indexing.
43+
- [*Retail AI Suite*](https://github.com/open-edge-platform/edge-ai-suites/tree/main/retail-ai-suite) — Accelerates development of edge AI applications for retail environments, enabling intelligent automation for use cases such as self-checkout, loss prevention, and store analytics with optimized Intel hardware and the OpenVINO™ toolkit.
44+
- [**Loss Prevention**](https://github.com/intel-retail/loss-prevention/tree/main) — Real-time self-checkout loss prevention using object detection and analytics to identify mis-scans and suspicious activity at the point of sale.
2845

2946
## Architecture Diagram
3047
![Archictecture Diagram](./docs/Architecture.png)
-446 KB
Loading

samples/ai/edge-ai-demo-studio/frontend/eslint.config.mjs

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright (C) 2026 Intel Corporation
22
// SPDX-License-Identifier: Apache-2.0
33

4+
import { readFileSync } from "node:fs";
5+
import { join } from "node:path";
46
import { FlatCompat } from "@eslint/eslintrc";
57
import { defineConfig, globalIgnores } from "eslint/config";
68
import nextVitals from "eslint-config-next/core-web-vitals";
@@ -12,6 +14,98 @@ const compat = new FlatCompat({
1214
baseDirectory: import.meta.dirname,
1315
});
1416

17+
// ─── Sample modularity: forbid static imports of optional services ──────────
18+
//
19+
// Optional service integrations are wired through the generated feature-provider
20+
// registry (`@/services/_generated/feature-providers`) so the export tool
21+
// (scripts/export-samples.mjs) can prune their folders with `--no-optional`.
22+
// The export walks the *static* import graph and force-includes any service
23+
// folder it reaches — so a sample that statically imports a service it declares
24+
// `optional` drags that folder back in and silently defeats `--no-optional`.
25+
// This rule reads each sample's data.ts and flags those imports.
26+
// See docs/OPTIONAL-SERVICES.md.
27+
28+
const SAMPLES_DIR = join(import.meta.dirname, "src", "samples");
29+
// Mirrors the dependency parser in scripts/export-samples.mjs (serviceId before
30+
// role, no nested braces — matches the shape of ServiceDependency literals).
31+
const DEP_RE =
32+
/\{\s*serviceId\s*:\s*['"]([\w-]+)['"][^{}]*?role\s*:\s*['"](required|optional)['"][^{}]*?\}/gs;
33+
const optionalDepsCache = new Map();
34+
35+
function optionalServiceIds(sampleId) {
36+
const cached = optionalDepsCache.get(sampleId);
37+
if (cached) return cached;
38+
const ids = new Set();
39+
try {
40+
const src = readFileSync(join(SAMPLES_DIR, sampleId, "data.ts"), "utf8");
41+
DEP_RE.lastIndex = 0;
42+
let m;
43+
while ((m = DEP_RE.exec(src)) !== null) {
44+
if (m[2] === "optional") ids.add(m[1]);
45+
}
46+
} catch {
47+
// Folder has no data.ts (not a sample) — nothing to enforce.
48+
}
49+
optionalDepsCache.set(sampleId, ids);
50+
return ids;
51+
}
52+
53+
const sampleModularityPlugin = {
54+
rules: {
55+
"no-optional-service-imports": {
56+
meta: {
57+
type: "problem",
58+
docs: {
59+
description:
60+
"Disallow a sample from statically importing a service it declares as an optional dependency; optional services must be reached only through the generated feature-provider registry so the export tool can prune them with --no-optional.",
61+
},
62+
schema: [],
63+
messages: {
64+
optionalImport:
65+
"Sample '{{sample}}' statically imports optional service '{{service}}' ('{{source}}'). A static import drags the service folder back into the export graph, so `--no-optional` can no longer prune it. Wire optional services through @/services/_generated/feature-providers (useFeatureProviders) or a shared @/context bridge instead. See docs/OPTIONAL-SERVICES.md.",
66+
},
67+
},
68+
create(context) {
69+
const filename = (context.filename ?? context.getFilename()).replace(
70+
/\\/g,
71+
"/",
72+
);
73+
const m = filename.match(/\/src\/samples\/([^/]+)\//);
74+
if (!m) return {};
75+
const sampleId = m[1];
76+
// `common` (shared barrels) and `_generated` are not samples and have no
77+
// per-sample role context to enforce.
78+
if (sampleId === "common" || sampleId === "_generated") return {};
79+
const optional = optionalServiceIds(sampleId);
80+
if (optional.size === 0) return {};
81+
82+
const check = (node) => {
83+
const value = node?.value;
84+
if (typeof value !== "string") return;
85+
// Only `@/services/<id>/...` specifiers carry a service folder; shared
86+
// entrypoints (_generated, common, types, registry) never match an
87+
// optional service id and are therefore allowed.
88+
const svc = value.match(/^@\/services\/([^/]+)(?:\/|$)/);
89+
if (svc && optional.has(svc[1])) {
90+
context.report({
91+
node,
92+
messageId: "optionalImport",
93+
data: { sample: sampleId, service: svc[1], source: value },
94+
});
95+
}
96+
};
97+
98+
return {
99+
ImportDeclaration: (node) => check(node.source),
100+
ExportNamedDeclaration: (node) => check(node.source),
101+
ExportAllDeclaration: (node) => check(node.source),
102+
ImportExpression: (node) => check(node.source),
103+
};
104+
},
105+
},
106+
},
107+
};
108+
15109
const eslintConfig = defineConfig([
16110
...nextVitals,
17111
...nextTs,
@@ -75,6 +169,54 @@ const eslintConfig = defineConfig([
75169
"no-console": "off",
76170
},
77171
},
172+
{
173+
files: ["src/services/**/*.{ts,tsx}"],
174+
rules: {
175+
"no-restricted-imports": [
176+
"error",
177+
{
178+
patterns: [
179+
{
180+
group: ["@/samples", "@/samples/**", "**/samples/**"],
181+
message:
182+
"Layering violation: services must not import from the samples tree (samples sit above services). This keeps services independently prunable and avoids a samples↔services cycle. Put shared contracts in @/context, @/hooks, or @/types. See docs/ARCHITECTURE-LAYERS.md and docs/OPTIONAL-SERVICES.md.",
183+
},
184+
],
185+
},
186+
],
187+
},
188+
},
189+
{
190+
files: ["src/engines/**/*.{ts,tsx}"],
191+
rules: {
192+
"no-restricted-imports": [
193+
"error",
194+
{
195+
patterns: [
196+
{
197+
group: [
198+
"@/samples",
199+
"@/samples/**",
200+
"**/samples/**",
201+
"@/services",
202+
"@/services/**",
203+
"**/services/**",
204+
],
205+
message:
206+
"Layering violation: engines are the bottom layer and must not import from the services or samples trees. Keep engines self-contained; put any shared contract in @/components, @/context, @/hooks, @/lib, or @/types instead. See docs/ARCHITECTURE-LAYERS.md.",
207+
},
208+
],
209+
},
210+
],
211+
},
212+
},
213+
{
214+
files: ["src/samples/**/*.{ts,tsx}"],
215+
plugins: { "sample-modularity": sampleModularityPlugin },
216+
rules: {
217+
"sample-modularity/no-optional-service-imports": "error",
218+
},
219+
},
78220
{
79221
settings: {
80222
react: { version: "19" },

samples/ai/edge-ai-demo-studio/frontend/knip.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,13 @@
1111
"src/components/ui/**",
1212
"src/components/ai-elements/**",
1313
"src/payload/migrations/**"
14+
],
15+
"ignoreDependencies": [
16+
"@streamdown/.+",
17+
"^prettier$",
18+
"^prettier-plugin-tailwindcss$",
19+
"^eslint-plugin-prettier$",
20+
"^libsql$",
21+
"^hast-util-to-jsx-runtime$"
1422
]
1523
}

samples/ai/edge-ai-demo-studio/frontend/next.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ const nextConfig: NextConfig = {
6767
},
6868
experimental: {
6969
proxyTimeout: 1000 * proxyTimeoutSetting(),
70+
proxyClientMaxBodySize: 500 * 1024 * 1024,
7071
},
7172
}
7273

0 commit comments

Comments
 (0)