Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aloception-oss cannot handle the indexing along temporal dimension for segmentation #333

Open
anhtu293 opened this issue Mar 14, 2023 · 0 comments
Assignees
Labels
aloscene aloscene bug Something isn't working

Comments

@anhtu293
Copy link
Contributor

Hello !

I encounter a problem when using aloscene.Frame and aloscene.Mask. aloception-oss is not able to handle correctly the temporal dimension of Mask. It's possibly due to the fact that Mask is not mergeable.

>>> from aloscene import Frame, Mask
>>> import torch
>>> x = torch.zeros((1, 1, 128, 128))
>>> frame1 = Frame(x, names=("T", "C", "H", "W"))
>>> y = torch.zeros((4, 128, 128))
>>> mask1 = Mask(y, names=("N","H","W")).temporal()
>>> frame1.append_segmentation(mask1)
>>> frame1
tensor(
	distortion=1.0
	normalization=255
	projection=pinhole
	segmentation=torch.Size([1, 4, 128, 128])
	[[[[0., 0., 0.,  ..., 0., 0., 0.],
          [0., 0., 0.,  ..., 0., 0., 0.],
          [0., 0., 0.,  ..., 0., 0., 0.],
          ...,
          [0., 0., 0.,  ..., 0., 0., 0.],
          [0., 0., 0.,  ..., 0., 0., 0.],
          [0., 0., 0.,  ..., 0., 0., 0.]]]])
>>> frame2 = frame1.clone()
>>> frame2
tensor(
	distortion=1.0
	normalization=255
	projection=pinhole
	segmentation=torch.Size([1, 4, 128, 128])
	[[[[0., 0., 0.,  ..., 0., 0., 0.],
          [0., 0., 0.,  ..., 0., 0., 0.],
          [0., 0., 0.,  ..., 0., 0., 0.],
          ...,
          [0., 0., 0.,  ..., 0., 0., 0.],
          [0., 0., 0.,  ..., 0., 0., 0.],
          [0., 0., 0.,  ..., 0., 0., 0.]]]])
>>> merge = torch.cat([frame1, frame2], dim=0)
>>> merge
tensor(
	distortion=1.0
	normalization=255
	projection=pinhole
	segmentation=[1, 1]
	[[[[0., 0., 0.,  ..., 0., 0., 0.],
          [0., 0., 0.,  ..., 0., 0., 0.],
          [0., 0., 0.,  ..., 0., 0., 0.],
          ...,
          [0., 0., 0.,  ..., 0., 0., 0.],
          [0., 0., 0.,  ..., 0., 0., 0.],
          [0., 0., 0.,  ..., 0., 0., 0.]]],


        [[[0., 0., 0.,  ..., 0., 0., 0.],
          [0., 0., 0.,  ..., 0., 0., 0.],
          [0., 0., 0.,  ..., 0., 0., 0.],
          ...,
          [0., 0., 0.,  ..., 0., 0., 0.],
          [0., 0., 0.,  ..., 0., 0., 0.],
          [0., 0., 0.,  ..., 0., 0., 0.]]]])
>>> merge[0].segmentation.names
('T', 'N', 'H', 'W')
>>> merge[0].segmentation.shape
torch.Size([1, 4, 128, 128])
>>> merge[0].names
('C', 'H', 'W')

Thanks VB Team for the support !

@anhtu293 anhtu293 self-assigned this Mar 14, 2023
@anhtu293 anhtu293 added bug Something isn't working aloscene aloscene labels Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aloscene aloscene bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant