You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""Read a tensor and return a data object containing a tensor of the image with
108
-
shape (batch, channels, height, width).
107
+
"""Read an input tensor and normalize it to shape (B, C, H, W).
109
108
110
109
Args:
111
-
tensor (torch.Tensor): Image tensor with values between 0-255. Accepted shapes: (H, W), (C, H, W), or (B, C, H, W) where C in {1, 3, 4}. Single-channel inputs are expanded to 3 channels, RGBA inputs have the alpha channel dropped.
112
-
fix_img_size (bool): Whether to resize the image to a fixed size. If False, the size_portrait and size_landscape are ignored. Default is False.
110
+
tensor (torch.Tensor): Image tensor with values between 0-255. Accepted
111
+
shapes are (H, W), (C, H, W), (H, W, C), or (B, C, H, W), where
112
+
C is in {1, 3, 4}. Unambiguous HWC tensors are converted to CHW.
113
+
Batched tensors currently support only B=1.
114
+
fix_img_size (bool): Whether to resize the image to a fixed size. If
115
+
False, size_portrait and size_landscape are ignored.
0 commit comments