Skip to content

test(mot): add comprehensive boundary tests for MoT module in training/eval modes (#54) - #189

Merged
isLinXu merged 1 commit into
Tencent:mainfrom
9-71:fix/issue54-mot-boundary-tests
Jul 30, 2026
Merged

test(mot): add comprehensive boundary tests for MoT module in training/eval modes (#54)#189
isLinXu merged 1 commit into
Tencent:mainfrom
9-71:fix/issue54-mot-boundary-tests

Conversation

@9-71

@9-71 9-71 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary of Changes

Addresses #54 by expanding boundary test coverage for the MoT (Mixture-of-Tracking) module under edge-case spatial dimensions and routing configurations, ensuring both forward pass integrity and backward gradient propagation during training.

Key Additions to tests/test_mot.py:

  1. Window Size > Feature Map (Boundary a):

    • Added test_mot_window_expert_handles_window_larger_than_feature_map_train and test_mot_block_handles_window_larger_than_feature_map_train.
    • Verifies padding/cropping logic and full gradient flow to experts & router when window_size exceeds input (H, W).
  2. Odd Spatial Dimensions Shift (Boundary b):

    • Added test_mot_window_expert_shift_odd_spatial_train and test_mot_block_shift_odd_spatial_train.
    • Ensures shift/unshift operations remain stable on odd grid sizes (e.g., 7x9, 9x11) in training mode.
  3. Exploration Epsilon Behavior (Boundary c):

    • Added test_mot_exploration_eps_active_in_train_disabled_in_eval and test_mot_exploration_eps_strict_zero_in_eval.
    • Explicitly validates dense routing during train() vs strictly sparse routing (Top-1) during eval().

Test Results

  • Unit Tests: 33/33 passed (pytest tests/test_mot.py).
  • Code Stability: Confirmed that ultralytics/nn/modules/mot/ handles all edge cases gracefully without requiring invasive runtime patches.
  • Lint Status: All new test code is compliant with ruff.

…ptions (Tencent#54)

Co-Authored-By: Claude <noreply@anthropic.com>
@isLinXu

isLinXu commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

LGTM

@isLinXu
isLinXu merged commit d3341f3 into Tencent:main Jul 30, 2026
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.

2 participants