Skip to content

Commit

Permalink
Merge pull request #214 from openspyrit/romain_dev_from_clean
Browse files Browse the repository at this point in the history
removed duplicate doc lines
  • Loading branch information
romainphan committed May 28, 2024
2 parents 6e94629 + b078249 commit 54a807a
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions spyrit/core/warp.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,13 @@ class DeformationField(nn.Module):
[-1;-1] corresponds to the center of the top-left pixel.
Args:
:attr:`field` (torch.tensor):
:attr:`field` (torch.tensor):
*Inverse deformation field* :math:`u` of shape :math:`(n\_frames,H,W,2)`,
where :math:`n\_frames` is the number of frames in the animation, and
:math:`H` and :math:`W` are the height and width of the image to be
warped. For accuracy reasons, the dtype is converted to `torch.float64`.
Attributes:
:attr:`self.field` (torch.tensor):
:attr:`self.field` (torch.tensor):
*Inverse deformation field* :math:`u` of shape :math:`(n\_frames,h,w,2)`.
Expand All @@ -72,14 +70,12 @@ class DeformationField(nn.Module):
>>> u = torch.tensor([[[[ 0.5, -0.5], [ 0.5, 0.5]], [[-0.5, -0.5], [-0.5, 0.5]]]])
>>> field = DeformationField(u)
>>> print(field.field)
>>> print(field.field)
tensor([[[[ 0.5, -0.5], [ 0.5, 0.5]], [[-0.5, -0.5], [-0.5, 0.5]]]])
**Example 2:** Rotating a 2x2 B&W image by 90 degrees clockwise, using one frame
>>> u = torch.tensor([[[[-1, 1], [-1, -1]], [[ 1, 1], [ 1, -1]]]])
>>> field = DeformationField(u)
>>> print(field.field)
>>> print(field.field)
tensor([[[[-1, 1], [-1, -1]], [[ 1, 1], [ 1, -1]]])
"""

Expand Down Expand Up @@ -146,7 +142,6 @@ def forward(
Deforms the vectorized image according to the *inverse deformation
field* :math:`u` contained in the attribute :attr:`field`,
field* :math:`u` contained in the attribute :attr:`field`,
sliced between the frames :math:`n0` (included) and :math:`n1` (excluded).
:math:`u` is the field that maps the pixels of the *deformed image* to
the pixels of the *original image*.
Expand Down Expand Up @@ -179,7 +174,6 @@ def forward(
as follows: ``field[n0:n1, :, :, :]``
.. note::
If :math:`n0 > n1`, :attr:`field` is sliced
If :math:`n0 > n1`, :attr:`field` is sliced
"backwards". The first frame of the warped animation corresponds to
the index :math:`n0`, and the last frame corresponds to the index
Expand All @@ -191,7 +185,6 @@ def forward(
The deformed batch of images of shape :math:`(|n1-n0|,c,h,w)`, where each
image in the batch is deformed according to the *inverse deformation
field* :math:`u` contained in the attribute :attr:`field`.
field* :math:`u` contained in the attribute :attr:`field`.
Shape:
:attr:`img`: :math:`(c,h,w)`, where :math:`c` is the number of
Expand Down

0 comments on commit 54a807a

Please sign in to comment.