import videodbconn = videodb.connect()# Create a reusable eventevent_id = conn.create_event( event_prompt="Detect when a person enters a restricted area", label="intrusion_detected")# Attach to a scene indexscene_index.create_alert( event_id=event_id, callback_url="https://your-backend.com/alerts")
The event_prompt is what the AI uses to evaluate each indexed scene. Be specific:
# Too vague - will trigger on many scenesevent_prompt = "Detect anything unusual"# Better - specific conditionevent_prompt = "Detect when a vehicle runs a red light"# Best - specific with contextevent_prompt = "Detect when a vehicle enters the intersection while the traffic light is red"
# Intrusion detectionconn.create_event( event_prompt="Detect when a person enters the warehouse after hours", label="after_hours_entry")# Fall detectionconn.create_event( event_prompt="Detect when a person falls or collapses", label="fall_detected")# Unauthorized accessconn.create_event( event_prompt="Detect when someone accesses the server room without a badge", label="unauthorized_access")
# Queue detectionconn.create_event( event_prompt="Detect when more than 5 people are waiting in line", label="queue_long")# Spill detectionconn.create_event( event_prompt="Detect liquid spills on the floor", label="spill_detected")# Shelf monitoringconn.create_event( event_prompt="Detect when a shelf appears empty or low on products", label="shelf_empty")
# Traffic violationconn.create_event( event_prompt="Detect when a vehicle runs a red light or stop sign", label="traffic_violation")# Wrong-way drivingconn.create_event( event_prompt="Detect a vehicle driving in the wrong direction", label="wrong_way")# Congestionconn.create_event( event_prompt="Detect when traffic has stopped or is moving very slowly", label="congestion_detected")
# Weak: unclear criteria"Detect suspicious activity"# Strong: observable criteria"Detect when someone looks into car windows repeatedly or tries door handles"