File size: 4,800 Bytes
4346a4c
 
 
 
1fd49b5
4346a4c
9d3bc6e
4346a4c
 
 
8f88466
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
---
title: Open-World Object Intelligence Platform
emoji: πŸ‘οΈ
colorFrom: indigo
colorTo: blue
sdk: gradio
sdk_version: 4.44.1
app_file: app.py
pinned: false
license: mit
hardware: gpu
---

# Open-World Object Intelligence Platform

[![Hugging Face Spaces](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue)](https://huggingface.co/spaces)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

> **Complete System Architecture, Product Specification, ML Pipelines, Live Testing, Downloads, Guides, API, Database, and Hugging Face Deployment Plan**

---

## 🌟 Key Features

1. **Known Object Detection (RT-DETR)**: Fast, predictable object detection for standard COCO classes using RT-DETR.
2. **Open-Vocabulary Discovery (YOLO-World)**: Zero-shot visual concept detection driven by dynamic text prompts without detector retraining.
3. **Specific Object Recognition (Visual Embeddings)**: Deep PyTorch vision feature extractor + cosine similarity search to teach and recognize specific physical objects (*e.g. My Cup* vs generic *cups*).
4. **πŸ”’ Lock Mode Target Filtering**: Restricts output bounding boxes so that **ONLY** objects matching your lock target (*e.g., 'My Cup', 'red backpack'*) are displayed on the live feed. Non-matching objects are completely suppressed.
5. **Result Fusion Engine**: Smart Non-Maximum Suppression (NMS) and IoU deduplication that prioritizes specific taught object identities over generic category labels.
6. **Hugging Face Spaces & Gradio Web App**: Sleek glassmorphic web interface built with Gradio and FastAPI ready for 1-click Hugging Face Spaces deployment.
7. **Python SDK & OpenCV Examples**: Clean client SDK (`object_intelligence`) with ready-to-run OpenCV webcam scripts.
8. **Portable Custom Object Database**: Portable SQLite database with ZIP import/export capabilities for taught object libraries.

---

## πŸ—οΈ System Architecture

```
                 OBJECT INTELLIGENCE PLATFORM
                              |
      +-----------------------+-----------------------+
      |                       |                       |
      v                       v                       v
 KNOWN OBJECTS          OPEN VOCABULARY        SPECIFIC OBJECTS
    RT-DETR               YOLO-World             Embeddings
      |                       |                       |
      +-----------------------+-----------------------+
                              |
                              v
                        RESULT FUSION
                              |
                     +--------+--------+
                     |                 |
                     v                 v
                NORMAL MODE        LOCK MODE
                     |                 |
                     |           Target matching
                     |                 |
                     |                 v
                     |          Only target boxes
                     |                 |
                     +--------+--------+
                              |
                              v
                     OBJECT KNOWLEDGE DB
```

---

## πŸš€ Quick Start

### 1. Installation

```bash
git clone https://github.com/user/Object-Intelligence.git
cd Object-Intelligence
pip install -r requirements.txt
```

### 2. Run Application Locally

```bash
python app.py
```
Open your browser at `http://localhost:7860`.

---

## 🐍 Python SDK Usage

```python
from object_intelligence import ObjectDetector
import cv2

# Initialize detector client
detector = ObjectDetector()

# Select mode ('combined', 'known', 'open_vocabulary', 'specific')
detector.set_mode("combined")

# Enable Lock Mode for a specific target
detector.lock("My Cup")

# Process frame
frame = cv2.imread("sample.jpg")
annotated_frame, detections = detector.detect_and_draw(frame)

# Save result
cv2.imwrite("output.jpg", annotated_frame)
```

---

## 🧠 Teaching Custom Objects

Teach the system new physical objects using reference photos:

```python
from object_intelligence import ObjectDetector

detector = ObjectDetector()
detector.add_object(
    name="My Cup",
    images=["cup_front.jpg", "cup_back.jpg", "cup_side.jpg"],
    category="Drinkware",
    description="Personal blue mug with handle"
)
```

---

## 🌐 Deploying to Hugging Face Spaces

1. Create a new **Gradio** Space on Hugging Face.
2. Upload this repository (`app.py`, `requirements.txt`, `backend/`, `object_intelligence/`, `docs/`, `examples/`).
3. Hugging Face Spaces will automatically install dependencies and run `app.py`!

---

## πŸ“„ License

Distributed under the MIT License. See `LICENSE` for details.