Object Enrollment
Register object classes and extract embeddings for the detection database
The enrollment phase prepares reference embeddings for object classes that will be detected and classified during real-time recognition.
Enrollment is a one-time setup process where reference images are processed to create embeddings stored in the object database.
Organize reference images by class:
objects/
├── helmet/
│ ├── helmet_01.jpg
│ ├── helmet_02.jpg
│ └── helmet_03.jpg
├── safety_vest/
│ ├── vest_front.jpg
│ └── vest_back.jpg
└── fire_extinguisher/
├── ext_01.jpg
└── ext_02.jpg
| Requirement | Description |
|---|
| Folder name | Becomes the class label |
| Image format | JPG, PNG, or WEBP |
| Image quality | Clear, well-lit reference images |
| Quantity | 3-10 images per class recommended |
| Step | Action | Output |
|---|
| 1 | Load reference images | Raw image data |
| 2 | Run YOLO detection | Bounding boxes |
| 3 | Extract features | Embedding vectors |
| 4 | Average embeddings | Single class embedding |
| 5 | Store in database | Class → Embedding mapping |
| Parameter | Default | Description |
|---|
model | yolov8n | YOLO model variant |
embedding_dim | 512 | Feature vector dimension |
min_confidence | 0.5 | Minimum detection confidence |
batch_size | 16 | Images per batch |
| Field | Type | Description |
|---|
class_id | INTEGER | Primary key |
class_name | VARCHAR | Human-readable label |
embedding | VECTOR | Feature embedding |
image_count | INTEGER | Reference images used |
created_at | TIMESTAMP | Enrollment timestamp |
| Guideline | Reason |
|---|
| Multiple angles | Improves matching accuracy |
| Varied lighting | Handles real-world conditions |
| Clean backgrounds | Reduces noise in embeddings |
| Typical scale | Match expected detection size |
| Recommendation | Description |
|---|
| Descriptive names | Use clear, meaningful class labels |
| Consistent naming | Use underscores, lowercase |
| Separate variants | Create distinct classes for different types |
To update an existing class:
| Scenario | Action |
|---|
| Add images | Run enrollment with --append flag |
| Replace class | Delete existing, then re-enroll |
| Remove class | Delete from database by class_id |