File size: 1,365 Bytes
4346a4c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# Lock Mode Specification & Filtering Engine

## Overview
**Lock Mode** restricts visual detection output so that **ONLY** objects matching a target string are rendered or returned.

```
All Pipeline Detections ──► Target Matcher ──► Match? ──YES──► Render Box & Tag
                                                 β”‚
                                                 └──NO───► Suppress (No Box Rendered)
```

## Architectural Contract
- **Suppression Before Rendering**: Filtering occurs in the backend/orchestrator before returning bounding boxes to the client or drawing on frames.
- **Persistent Lock Target**: The lock target remains active across incoming webcam / stream frames until explicitly unlocked.
- **Header Indicator Banner**: Annotated frames display a prominent lock status banner: `πŸ”’ LOCK MODE ACTIVE | Target: '<target>'`.

## Supported Target Types
1. **Generic Category Target**: `cup`, `laptop`, `person`
2. **Open-Vocabulary Prompt**: `red backpack`, `wireless mouse`
3. **Specific Taught Identity**: `My Cup`, `Lab Keys`

## SDK Example

```python
from object_intelligence import ObjectDetector

detector = ObjectDetector()
detector.lock("My Cup")

# Only 'My Cup' bounding boxes will be returned/drawn
annotated_frame, detections = detector.detect_and_draw(frame)

# To unlock
detector.unlock()
```