Skip to content

feat: add anisotropic personal space, social dyads, shared-space CPA, and pose distraction classifier - #589

Open
M-Colley wants to merge 2 commits into
PedestrianDynamics:mainfrom
M-Colley:feat/anisotropic-personal-space-and-dyads
Open

M-Colley wants to merge 2 commits into
PedestrianDynamics:mainfrom
M-Colley:feat/anisotropic-personal-space-and-dyads

Conversation

@M-Colley

@M-Colley M-Colley commented Nov 21, 2026 •

Copy link
Copy Markdown

Summary

Introduces pedpy.methods.anisotropic_space_calculator (and top-level exports in pedpy) adding four microscopic pedestrian analysis and trajectory-enrichment methods aligned with PedPy's TrajectoryData contract:

  1. compute_anisotropic_personal_space:

    • Computes velocity- and attention-modulated heading-aligned elliptical personal space semi-axes (a_m, b_m), anisotropy ratio a_b_ratio, ellipse_area_m2, and minimum normalized elliptical neighbor distance min_d_eff.
  2. detect_social_dyads:

    • Detects persistent co-walking dyads across shared frames, rejecting counter-flow passings and classifying "abreast" vs. "single_file" formation angles.
  3. compute_shared_space_cpa:

    • Computes Closest Point of Approach (tau_cpa_s, d_cpa_m, closing_speed_mps, is_encroachment) between pedestrians and cyclists/e-scooters.
  4. classify_pose_distraction_coco17:

    • Torso-normalized, coordinate-orientation-invariant MS-COCO 17-keypoint smartphone posture classifier (combining downward head pitch and elbow flexion / hand-in-chest-zone) for enriching TrajectoryData attention columns from 2D pose detections.

Verification

pytest tests/unit_tests/methods/test_anisotropic_space_calculator.py tests/unit_tests/methods/test_trajectory_data_type_check.py -v

@M-Colley
M-Colley force-pushed the feat/anisotropic-personal-space-and-dyads branch from 2153d25 to c71405f Compare November 21, 2026 11:35
@codecov

codecov Bot commented Nov 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.98726% with 44 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.22%. Comparing base (0604d9a) to head (c71405f).

Files with missing lines Patch % Lines
pedpy/methods/anisotropic_space_calculator.py 85.94% 44 Missing ⚠️

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant