Robotics
LeRobot
Safetensors
pi05
bimanual
arx
pi05-arx-stack-three-cups-step10k / deploy /example_client_fn.py
spikefly's picture
Add files using upload-large-folder tool
8b24ae0 verified
Raw History Blame Contribute Delete
537 Bytes
"""Template for `fit_check_pi05_cups.py --client-fn example_client_fn:opencv_camera_to_tensor --client-frame-format bgr`.
Replace the body with YOUR robot-side code path (camera frame -> model image tensor). Must return float (3, H, W) in [0, 1]."""
import numpy as np
import torch
def opencv_camera_to_tensor(frame_bgr_uint8: np.ndarray) -> torch.Tensor:
rgb = frame_bgr_uint8[:, :, ::-1] # OpenCV delivers BGR; the model was trained on RGB
return torch.from_numpy(np.ascontiguousarray(rgb)).permute(2, 0, 1).float() / 255.0