You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/cross-platform/multimodel_mnn_v9/4_mnn_vision.md
+48-25Lines changed: 48 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,37 +6,41 @@ layout: learningpathall
6
6
7
7
## Prepare a local image asset
8
8
9
-
In this module you will implement a **smart retail shelf audit** using a single local image.
9
+
In this module you will run a **retail shelf walk audit** using a single image and an Omni multimodal model on MNN.
10
10
11
-
The model will:
11
+
Instead of trying to do SKU-accurate counting (which is difficult and unreliable on real-world shelf photos), you will generate an **actionable store-operations signal**:
12
12
13
-
-Inspect a**pet food aisle** image
14
-
-Estimate **facing coverage** for three shelf levels: **top / middle / bottom**
15
-
-Identify a**priority zone**that appears most sparse
16
-
-Use `NOT_SURE`where the image is ambiguous
13
+
-A coarse**facing coverage** estimate for **top / middle / bottom** shelf levels
14
+
-A single **priority zone** that appears most sparse
15
+
-A short**reason**grounded in what is visible
16
+
-`NOT_SURE`when the image is ambiguous
17
17
18
+
This is a common retail workflow: the goal is to decide **where to restock first**, not to perfectly count every unit.
## Step 2 - Create the vision prompt (single line)
40
44
41
45
You will design a prompt that:
42
46
@@ -49,24 +53,43 @@ You will design a prompt that:
49
53
Create the prompt file (adjust `/home/radxa` to your actual user home if needed):
50
54
51
55
```bash
52
-
cat >~/mnn_lp/prompt_picture_coverage.txt <<'EOF'
53
-
<img>/home/radxa/mnn_lp/assets/pet_food_aisle.jpg</img> You are an on-device retail shelf auditing assistant. Audit ONLY the main left shelf (ignore the aisle on the right, hanging toys, and floor items). Do NOT count every item. Estimate facing coverage for top/middle/bottom as high|medium|low and identify the sparsest zone. Output ONE line only using bullet-style segments separated by semicolons: Shelf audit; - Coverage: top=<high|medium|low>, middle=<high|medium|low>, bottom=<high|medium|low>; - Priority zone: <top|middle|bottom>-<left|center|right>; - Reason: <one short sentence>; - Notes: <NOT_SURE if unclear>.
56
+
cat >~/mnn/prompt_picture_coverage.txt <<'EOF'
57
+
<img>/home/radxa/mnn/assets/Pet_Food_Aisle.jpg</img> You are an on-device retail shelf auditing assistant. Audit ONLY the main left shelf (ignore the aisle on the right, hanging toys, and floor items). Do NOT count every item. Estimate facing coverage for top/middle/bottom as high|medium|low and identify the sparsest zone. Output ONE line only using bullet-style segments separated by semicolons: Shelf audit; - Coverage: top=<high|medium|low>, middle=<high|medium|low>, bottom=<high|medium|low>; - Priority zone: <top|middle|bottom>-<left|center|right>; - Reason: <one short sentence>; - Notes: <NOT_SURE if unclear>.
prompt file is /home/radxa/mnn/prompt_picture_coverage.txt
85
+
Shelf audit; - Coverage: top=high, middle=high, bottom=medium; - Priority zone: top-left; - Reason: top and middle have more variety than bottom, and left is where most items are; - Notes: NOT_SURE if unclear. How does this sound? Let me know if you need further clarification or have other questions! I'm here to help with more details if you want! 😊
86
+
If you have any other questions about this shelf auditing, feel free to let me know! 😊
87
+
```
68
88
89
+
The exact words may differ, but the output should contain:
69
90
- Includes coverage estimates for **top / middle / bottom**
70
91
- Identifies a **priority zone** such as `middle-center`
71
92
- Provides a **short reason** that clearly references visible sparsity on the shelf
72
-
- Uses `NOT_SURE` only where the image is genuinely unclear
93
+
- Uses `NOT_SURE` only where the image is genuinely unclear
94
+
95
+
In the next module you will run an audio restock instruction demo using an <audio>...</audio> prompt.
Copy file name to clipboardExpand all lines: content/learning-paths/cross-platform/multimodel_mnn_v9/5_mnn_vision_audio.md
+67-23Lines changed: 67 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,25 +4,41 @@ weight: 6
4
4
layout: learningpathall
5
5
---
6
6
7
-
## Scenario
7
+
In this module you will convert a **spoken restock note** into a **readable, single-line restock ticket** using MNN Omni.
8
8
9
-
In this module you will convert a **spoken restock note** into a structured **restock ticket**.
9
+
This mirrors a common retail workflow: an associate records a short voice note during a shelf walk, and the system converts it into an operational ticket that can be handed to staff or logged in a task system.
10
10
11
-
For example, a store associate might say:
11
+
Because `llm_demo` output may normalize newlines on some terminals, this module uses a **single-line** format with `;`-separated fields.
12
12
13
-
> We need to restock large dog food bags on the bottom-left, four units, before tomorrow afternoon. If large bags are out of stock, use medium bags as a substitute.
13
+
## Step 1 - Prepare the audio asset
14
14
15
-
Your goal is to:
15
+
Before you run the demo, make sure you know what your `restock_note.wav` contains. This learning path assumes the WAV is a short “store associate voice note” describing what to restock.
16
16
17
-
- Extract **items, quantities, zones, deadlines, and substitution policy**
18
-
- Encode them as a **single-line ticket** with clearly labeled fields
17
+
### Suggested Audio Content Scenario
19
18
20
-
## Assets
19
+
Record (or provide) a short voice note similar to the following:
21
20
22
-
Prepare a WAV file under `assets`:
21
+
* Please restock the bottom-left large pet food bags, add ten bags.
22
+
* Also restock the middle-left canned pet food, add twenty-four cans.
23
+
* Finish before 3 PM today. If something is out of stock, use a similar substitute.
24
+
25
+
Your goal in this module is to extract these fields from the audio:
26
+
27
+
-**Items**
28
+
-**Quantities**
29
+
-**Zones**
30
+
-**Deadline**
31
+
-**Substitution policy**
32
+
33
+
…and encode them as a **single-line ticket** with labeled fields.
34
+
35
+
36
+
### Verify the WAV file format
37
+
38
+
This demo expects a WAV (RIFF) file: For example `restock_note.wav`
23
39
24
40
```bash
25
-
file ~/mnn_lp/assets/restock_note.wav
41
+
file ~/mnn/assets/restock_note.wav
26
42
```
27
43
28
44
If you only have an MP3 file, convert it to a suitable WAV format:
This produces a **mono, 16 kHz, 16-bit PCM** WAV file, which is commonly used for speech models.
35
51
52
+
```
53
+
This is the pet food aisle, left shelf. Please restock the bottom left large pet food bags, add 10 bags. Also restock the middle left canned food, add 24 cans. Finish before 3 PM today. If something is out of stock, use a similar substitute.
54
+
```
36
55
37
-
## Prompt design
56
+
## Step 2 - Create the audio prompt
38
57
39
-
You will ask the model to produce a **readable, single-line ticket** with:
58
+
llm_demo commonly treats ***each line*** as a separate prompt. Keep this prompt file as ***one line***.
40
59
41
-
- Item
42
-
- Quantity (or `NOT_SURE` if not spoken)
43
-
- Shelf zone
44
-
- Deadline
45
-
- Substitution policy
46
-
- Notes and confidence
60
+
This prompt instructs the model to:
61
+
- Use ***generic*** item labels (avoid brands unless clearly spoken)
62
+
- Output ***NOT_SURE*** for fields not stated in the audio
63
+
- Produce a single-line ticket that is easy to read and parse
47
64
48
-
Create the prompt file:
49
65
50
66
```bash
51
-
cat >~/mnn_lp/prompt_audio_ticket.txt <<'EOF'
52
-
<audio>/home/radxa/mnn_lp/assets/restock_note.wav</audio> You are a retail store replenishment assistant. Convert the spoken note into a restocking ticket. Output EXACTLY ONE line using bullet-style segments separated by semicolons: Restock ticket; - Location: pet food aisle left shelf; - Task 1: <generic item> | qty <number or NOT_SURE> | zone <top|middle|bottom>-<left|center|right or NOT_SURE>; - Task 2: <generic item> | qty <number or NOT_SURE> | zone <top|middle|bottom>-<left|center|right or NOT_SURE>; - Deadline: <time or NOT_SURE>; - Substitution: <use similar substitute|no substitute|NOT_SURE>; - Notes: <short note>; - Confidence: <high|medium|low>. Rules: do not invent quantities if not in audio.
67
+
cat >~/mnn/prompt_audio_ticket.txt <<'EOF'
68
+
<audio>/home/radxa/mnn/assets/restock_note.wav</audio> You are a retail store replenishment assistant. Convert the spoken note into a restocking ticket. Output EXACTLY ONE line using bullet-style segments separated by semicolons: Restock ticket; - Location: pet food aisle left shelf; - Task 1: <generic item> | qty <number or NOT_SURE> | zone <top|middle|bottom>-<left|center|right or NOT_SURE>; - Task 2: <generic item> | qty <number or NOT_SURE> | zone <top|middle|bottom>-<left|center|right or NOT_SURE>; - Deadline: <time or NOT_SURE>; - Substitution: <use similar substitute|no substitute|NOT_SURE>; - Notes: <short note>; - Confidence: <high|medium|low>. Rules: do not invent quantities if not in audio.
- Confidence: medium. Restock the large pet food bag and canned food as per the given quantities. If any item is out of stock, replace it with a similar substitute. Make sure it's done by 3 p.m. today. Let me know if you need further clarification or if there's anything else on your mind.
Copy file name to clipboardExpand all lines: content/learning-paths/cross-platform/multimodel_mnn_v9/6_mnn_restock_ticket.md
+48-18Lines changed: 48 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,25 +6,34 @@ layout: learningpathall
6
6
7
7
## Create the single-shot multimodal prompt (image + audio)
8
8
9
-
In this final project you will combine:
9
+
In this final project you will generate an **operational restock ticket** from **one single-shot multimodal prompt**.
10
10
11
-
- A **shelf image** for coverage and priority zone
12
-
- A **voice note** for tasks, quantities, deadlines, and substitution policy
11
+
You will combine:
12
+
- A **shelf image** to estimate shelf coverage and select a priority zone
13
+
- A **voice note** to extract tasks, quantities, zones, deadlines, and substitution policy
13
14
14
-
into **one multimodal prompt** that produces an **operational restock ticket** in a single inference.
15
+
into **one multimodal inference** using MNN Omni.
16
+
17
+
This mirrors a real retail workflow: a staff member captures a shelf photo and records a quick voice note, and the device produces a ticket that can be executed immediately.
15
18
16
19
17
20
## Inputs
18
21
19
-
You will reuse the same assets:
22
+
You will reuse the same local assets from previous modules:
-**Priority zone (image-derived):**`<top|middle|bottom>-<left|center|right>`
@@ -34,27 +43,48 @@ The output is a **single-line, bullet-style ticket** that must include:
34
43
-**Notes and confidence**
35
44
36
45
37
-
## Prompt and run
46
+
## Step 1 Create the multimodal prompt (single line)
38
47
39
-
Create the multimodal prompt file:
48
+
Create the multimodal prompt file. Keep the file as **one line**.
40
49
41
50
```bash
42
-
cat >~/mnn_lp/prompt_final_multimodal.txt <<'EOF'
43
-
<img>/home/radxa/mnn_lp/assets/pet_food_aisle.jpg</img> <audio>/home/radxa/mnn_lp/assets/restock_note.wav</audio> You are an on-device retail replenishment assistant. Use the IMAGE to estimate facing coverage for the main LEFT shelf by level as high|medium|low and pick a priority zone. Use the AUDIO to extract item requests including quantities, zones, deadline, and substitution policy. Output EXACTLY ONE line using bullet-style segments separated by semicolons: Restock ticket; - Location: pet food aisle left shelf; - Coverage: top=<high|medium|low>, middle=<high|medium|low>, bottom=<high|medium|low>; - Priority zone: <top|middle|bottom>-<left|center|right>; - Task 1: <generic item> | qty <number or NOT_SURE> | zone <top|middle|bottom>-<left|center|right or NOT_SURE>; - Task 2: <generic item> | qty <number or NOT_SURE> | zone <top|middle|bottom>-<left|center|right or NOT_SURE>; - Deadline: <time or NOT_SURE>; - Substitution: <use similar substitute|no substitute|NOT_SURE>; - Notes: <short operational note>; - Confidence: <high|medium|low>. Rules: Qty/Deadline/Substitution must come from audio; if audio contains explicit numbers you must output them.
51
+
cat >~/mnn/prompt_final_multimodal.txt <<'EOF'
52
+
<img>/home/radxa/mnn/assets/Pet_Food_Aisle.jpg.jpg</img> <audio>/home/radxa/mnn/assets/restock_note.wav</audio> You are an on-device retail replenishment assistant. Use the IMAGE to estimate facing coverage for the main LEFT shelf by level as high|medium|low and pick a priority zone. Use the AUDIO to extract item requests including quantities, zones, deadline, and substitution policy. Output EXACTLY ONE line using bullet-style segments separated by semicolons: Restock ticket; - Location: pet food aisle left shelf; - Coverage: top=<high|medium|low>, middle=<high|medium|low>, bottom=<high|medium|low>; - Priority zone: <top|middle|bottom>-<left|center|right>; - Task 1: <generic item> | qty <number or NOT_SURE> | zone <top|middle|bottom>-<left|center|right or NOT_SURE>; - Task 2: <generic item> | qty <number or NOT_SURE> | zone <top|middle|bottom>-<left|center|right or NOT_SURE>; - Deadline: <time or NOT_SURE>; - Substitution: <use similar substitute|no substitute|NOT_SURE>; - Notes: <short operational note>; - Confidence: <high|medium|low>. Rules: Qty/Deadline/Substitution must come from audio; if audio contains explicit numbers you must output them.
prompt file is /home/radxa/mnn/prompt_final_multimodal.txt
78
+
Restock the bottom left large pet food bag, add 10 bags; also restock the middle left canned food, add 24 cans. Finish before 3 PM today. If something is out of stock, use a similar substitute.- Restock ticket: Location: pet food aisle left shelf, Coverage: top=low, middle=low, bottom=high, Priority zone: bottom-left, Task 1: pet food | qty 10 | zone bottom-left, Task 2: canned food | qty 24 | zone middle-left, Deadline: 3 PM today, Substitution: use similar substitute, Notes: Ensure proper storage conditions, Confidence: high.
79
+
80
+
```
81
+
82
+
Exact wording may differ, but the coverage/priority should be image-driven and the quantities/deadline/substitution should be audio-driven.
83
+
84
+
85
+
## Step 3 - Verify image and audio are both used (optional)
56
86
57
-
## Verify image and audio are both used (optional)
87
+
To verify true multimodal behavior, perform a simple A/B test.
58
88
59
89
- Swap the **audio** file: quantities/deadline/substitution should change.
60
90
- Swap the **image** file: coverage/priority zone should change.
0 commit comments