Skip to content

docs(quest): add realtime-pipeline Quest setup; fix np.trapz + cli glue#15

Open
AlanYWu wants to merge 1 commit into
final-realtime-pipelinefrom
docs/quest-realtime-and-fixes
Open

docs(quest): add realtime-pipeline Quest setup; fix np.trapz + cli glue#15
AlanYWu wants to merge 1 commit into
final-realtime-pipelinefrom
docs/quest-realtime-and-fixes

Conversation

@AlanYWu

@AlanYWu AlanYWu commented May 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add docs/running-on-quest.md adapted to the final-realtime-pipeline
    architecture (two WebSockets — ws://127.0.0.1:8765 predictions,
    ws://127.0.0.1:8766 markers), driven by python -m pipeline collect
    and python -m pipeline realtime, with FreeNavScene wiring and Path B
    adb reverse / LAN instructions for both ports. Replaces the old
    tools/bci_ws_stub_server.py flow on port 5000.
  • Fix np.trapz (removed in NumPy 2.x) → np.trapezoid in
    eeg_to_meta/inference.py and ml_pipeline/features.py. Without this,
    pipeline realtime crashes on first inference under NumPy ≥ 2.0.
  • pipeline/cli.py: drop the --mi-threshold / --blink-threshold
    flags and the override block — per-class thresholds stay hardcoded in
    the classifier model bundle's CLASS_THRESHOLDS. Also forward
    participant and sentinel mi_threshold=None, blink_threshold=None
    on the eeg_args Namespace so eeg_to_meta/main.py:run_pipeline
    doesn't AttributeError.

Verification

  • python -m pipeline realtime --participant 5 --skip-personalize \\ --model ml_pipeline/models/realtime_models.pkl --mock boots the
    WebSocket on ws://127.0.0.1:8765 and emits stable predictions
    (Active class thresholds: {mi_*: 0.55, intentional_blink: 0.6}).

Test plan

  • Unity FreeNavScene Editor Play → log shows
    [PredictionWebSocketClient] Connected to ws://127.0.0.1:8765
    and the server log flips to ws_clients=1.
  • AutoMove scene + python -m pipeline collect --participant N --runs 1 --mock → markers reach the Python collector on :8766.
  • Path B (APK on Quest): adb reverse tcp:8765 tcp:8765 and
    tcp:8766 tcp:8766, then re-verify both connects.

- Add docs/running-on-quest.md adapted to the final-realtime-pipeline:
  two sockets (ws://127.0.0.1:8765 predictions, ws://127.0.0.1:8766
  markers), pipeline collect/realtime commands, FreeNavScene wiring,
  and adb reverse / LAN options for both ports.
- Fix NumPy 2.x incompatibility: np.trapz -> np.trapezoid in
  eeg_to_meta/inference.py and ml_pipeline/features.py.
- pipeline/cli.py: forward participant + sentinel mi_threshold /
  blink_threshold = None on the eeg_args Namespace so
  eeg_to_meta/main.py:run_pipeline doesn't AttributeError; drop the
  --mi-threshold / --blink-threshold CLI flags so per-class thresholds
  stay hardcoded in the classifier model bundle's CLASS_THRESHOLDS.
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