Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions dust3r/utils/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ def rgb(ftensor, true_shape=None):
elif ftensor.ndim == 4 and ftensor.shape[1] == 3:
ftensor = ftensor.transpose(0, 2, 3, 1)
if true_shape is not None:
H, W = true_shape
ftensor = ftensor[:H, :W]
H, W = true_shape[-2:]
if ftensor.ndim == 4:
ftensor = ftensor[:, :H, :W]
else:
ftensor = ftensor[:H, :W]
if ftensor.dtype == np.uint8:
img = np.float32(ftensor) / 255
else:
Expand Down