LogoVisionLog

Detection Logging

Record and export object detection events with metadata

The logging stage records detection events with timestamps, locations, and confidence scores for analysis and reporting.

Overview

Every matched detection is logged with comprehensive metadata, enabling historical analysis, reporting, and integration with external systems.

Log Entry Schema

FieldTypeDescription
log_idUUIDUnique entry identifier
timestampTIMESTAMPDetection time (UTC)
class_idINTEGERMatched object class
class_nameVARCHARHuman-readable label
confidenceFLOATMatch confidence score
camera_idVARCHARSource camera identifier
bboxJSONBounding box coordinates
frame_idINTEGERSource frame number

Logging Pipeline

StepActionOutput
1Receive match resultDetection + class info
2Enrich metadataAdd timestamp, camera, location
3Duplicate checkPrevent rapid re-logging
4Write to databasePersisted log entry
5Trigger eventsWebhooks, alerts

Duplicate Prevention

Avoid logging the same object repeatedly:

ParameterDefaultDescription
cooldown_seconds30Minimum time between same object logs
iou_threshold0.7Spatial overlap threshold
track_id-Object tracking ID (if available)

Storage Options

BackendUse CaseFeatures
PostgreSQLProductionACID, queries, joins
SQLiteDevelopmentSimple, embedded
CSVExportHuman-readable, portable
JSON LinesStreamingAppend-only, flexible

Database Schema

CREATE TABLE detection_logs (
    log_id UUID PRIMARY KEY,
    timestamp TIMESTAMP NOT NULL,
    class_id INTEGER REFERENCES object_classes(id),
    class_name VARCHAR(100),
    confidence FLOAT,
    camera_id VARCHAR(50),
    bbox JSONB,
    frame_id INTEGER,
    created_at TIMESTAMP DEFAULT NOW()
);

CREATE INDEX idx_logs_timestamp ON detection_logs(timestamp);
CREATE INDEX idx_logs_class ON detection_logs(class_id);
CREATE INDEX idx_logs_camera ON detection_logs(camera_id);

Export Formats

FormatExtensionUse Case
CSV.csvSpreadsheet analysis
JSON.jsonAPI consumption
Parquet.parquetBig data pipelines
Excel.xlsxBusiness reports

Query Examples

Detections by Time Range

FilterDescription
TodayLogs from current date
Last hourRecent detections
Custom rangeStart and end timestamps

Detections by Class

FilterDescription
Single classAll logs for one object type
Multiple classesFilter by list
Exclude classesAll except specified

Aggregations

MetricDescription
Count by classTotal detections per type
Count by hourHourly detection volume
Count by cameraDetections per source
Average confidenceMean match confidence

Event Triggers

EventTriggerAction
New detectionAny match loggedWebhook, database write
High-value objectSpecific class detectedAlert notification
AnomalyUnusual detection patternEscalation
Threshold exceededCount > limitWarning

Retention Policy

StrategyDurationDescription
Keep allIndefiniteFull history
Rolling window30/90 daysDelete older logs
Archive1 yearMove to cold storage
Aggregate onlyAfter 30 daysKeep summaries

Integration

SystemMethodPurpose
REST APIHTTPExternal queries
WebhooksPOSTReal-time notifications
Message queuePub/subEvent streaming
DashboardSQLVisualization

On this page