Skip to content

Incorrect Channel Indexing in MultiInput #26

@pittforce

Description

@pittforce

When the input has 3 channels (x, y, confidence), the current indexing in the velocity and bone streams is incorrect.

Problem:

  • Long-term velocity is written to x_new[i, :, 1, 3:] but index 3 is also used for confidence.
  • Confidence is written to a hardcoded index 3 in both velocity and bone streams.
    It should always be written to index C + 1 to keep the channel order consistent.

Example Fix:

# Assume C = 3: input channels are [x, y, confidence]

# Velocity calculation:
# Short-term velocity (x, y) -> channels 0, 1
# Long-term velocity (x, y) -> channels 2, 3
# Confidence -> channel 4 (C + 1)
for i in range(T - 2):
    x_new[i, :, 1, :2] = x[i + 1, :, :2] - x[i, :, :2]    # Short-term velocity
    x_new[i, :, 1, 2:4] = x[i + 2, :, :2] - x[i, :, :2]   # Long-term velocity
x_new[:, :, 1, 4] = x[:, :, 2]                            # Correct confidence index

# Bone calculation:
# Confidence should also be written to channel 4 (C + 1)
x_new[:, :, 2, 4] = x[:, :, 2]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions