Spaces:
Running on Zero
Running on Zero
|
Download docs/lock-mode.md from muhammadpriv001/Object-Intelligence-Backend: direct link, hf CLI and curl.
- Browser
- Download file 1.37 kB
-
https://huggingface.co/spaces/muhammadpriv001/Object-Intelligence-Backend/resolve/main/docs/lock-mode.md
- Command line
-
hf download hf://spaces/muhammadpriv001/Object-Intelligence-Backend/docs/lock-mode.md
-
curl -L -o lock-mode.md https://huggingface.co/spaces/muhammadpriv001/Object-Intelligence-Backend/resolve/main/docs/lock-mode.md
1.37 kB
A newer version of the Gradio SDK is available: 6.30.0
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
- Generic Category Target:
cup,laptop,person - Open-Vocabulary Prompt:
red backpack,wireless mouse - Specific Taught Identity:
My Cup,Lab Keys
SDK Example
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()