mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-23 17:56:07 +00:00
chore(format): format code
This commit is contained in:
@@ -86,6 +86,7 @@ def check_chw_float32(frame: torch.Tensor) -> None:
|
|||||||
c, h, w = frame.shape
|
c, h, w = frame.shape
|
||||||
assert c < h and c < w, f"expect channel first images, but instead {frame.shape}"
|
assert c < h and c < w, f"expect channel first images, but instead {frame.shape}"
|
||||||
|
|
||||||
|
|
||||||
def to_hwc_uint8_numpy(chw_float32_torch: torch.Tensor) -> np.ndarray:
|
def to_hwc_uint8_numpy(chw_float32_torch: torch.Tensor) -> np.ndarray:
|
||||||
check_chw_float32(chw_float32_torch)
|
check_chw_float32(chw_float32_torch)
|
||||||
hwc_uint8_numpy = (chw_float32_torch * 255).type(torch.uint8).permute(1, 2, 0).numpy()
|
hwc_uint8_numpy = (chw_float32_torch * 255).type(torch.uint8).permute(1, 2, 0).numpy()
|
||||||
|
|||||||
@@ -108,9 +108,7 @@ def log_rerun_data(
|
|||||||
rr.log(f"{key}_{i}", rr.Scalars(float(vi)))
|
rr.log(f"{key}_{i}", rr.Scalars(float(vi)))
|
||||||
else:
|
else:
|
||||||
if arr.shape[-1] == 1:
|
if arr.shape[-1] == 1:
|
||||||
img_entity = (
|
img_entity = rr.DepthImage(arr, colormap=rr.components.Colormap.Viridis)
|
||||||
rr.DepthImage(arr, colormap=rr.components.Colormap.Viridis)
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
img_entity = rr.Image(arr).compress() if compress_images else rr.Image(arr)
|
img_entity = rr.Image(arr).compress() if compress_images else rr.Image(arr)
|
||||||
rr.log(key, entity=img_entity, static=True)
|
rr.log(key, entity=img_entity, static=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user