Skip to content

SpatialAugmentedTensor : calling temporal() after batch() causes misleading shapes and names #15

@thibo73800

Description

@thibo73800

SpatialAugmentedTensor methods temporal() and batch() behave as described in their documentation, but this behavior may be counter-intuitive for a user familiar with pytorch conventions.

Example

frame = aloscene.Frame(np.random.uniform(0, 1, (3, 50, 100)), names=("C", "H", "W"))
frame = aloscene.Frame.batch_list([frame, frame.clone()])
frame = frame.temporal()
print(f"names: {frame.names}\nshape: {frame.shape}")

Output

names: ('T', 'B', 'C', 'H', 'W')
shape: torch.Size([1, 2, 3, 50, 100])

We see that the temporal dimension is before the batch dimension. Which is logical if we consider the order in which we call the methods, but not aligned with the convention used for most models inputs.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions