"""Template for `fit_check_pi05.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