debug: 归一化图像到[0, 1]

This commit is contained in:
gouhanke
2026-02-11 16:47:39 +08:00
parent 130d4bb3c5
commit 320369ffb8

View File

@@ -87,6 +87,8 @@ class SimpleRobotDataset(Dataset):
if h5_path in f:
img = f[h5_path][meta["frame_idx"]]
img = torch.from_numpy(img).float()
# 归一化到 [0, 1] 范围(与推理时保持一致)
img = img / 255.0
frame[f"observation.{cam_name}"] = img.permute(2, 0, 1) # HWC -> CHW
return frame