mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-24 18:26:11 +00:00
major refactor of the forward pass and model input conversion
This commit is contained in:
committed by
Maximellerbach
parent
877847c90e
commit
31ddb8f493
@@ -215,8 +215,10 @@ class _FakeQwenInterface(nn.Module):
|
||||
@staticmethod
|
||||
def to_pixel_values(image_tensor: Tensor) -> Tensor:
|
||||
image = image_tensor.detach().float()
|
||||
if image.ndim == 3 and image.shape[0] == 1:
|
||||
image = image.repeat(3, 1, 1)
|
||||
if image.shape[-3] == 1:
|
||||
repeats = [1] * image.ndim
|
||||
repeats[-3] = 3
|
||||
image = image.repeat(*repeats)
|
||||
return image
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user