Skip to content

# Issue #36 — Implement REPEATED_APPROACH detection #63

@Devnil434

Description

@Devnil434

Description

A person repeatedly entering and leaving a restricted area is often a strong
suspicious behavior signal.

The current ActionClassifier does not detect repeated zone approaches.

Implement:

ActionHint.REPEATED_APPROACH

inside the action classification pipeline.


Expected Behavior

Trigger REPEATED_APPROACH when:

  • a person enters a restricted zone
  • exits it
  • re-enters again
  • repeated entry count >= 2

Suggested Logic

zone_entry_count = memory_store.get_zone_entry_count(
    obj.track_id,
    zone
)

if zone_entry_count >= 2:
    return ActionHint.REPEATED_APPROACH

Challenge

classify_action() currently has no direct access to MemoryStore.

Possible approaches:

  1. inject optional store dependency
  2. precompute counts in pipeline.py
  3. pass counters as parameters

Files to Touch

services/memory/action_classifier.py
services/memory/pipeline.py
tests/test_memory.py

Acceptance Criteria

  • Fires only on second+ entry
  • Does not spam every frame
  • Supports cooldown behavior
  • Existing tests remain green
  • Add at least 3 unit tests

Helpful Context

Relevant modules:

services/memory/action_classifier.py
services/memory/pipeline.py
libs/schemas/memory.py

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions