From 86e60499d00307d7cea48a562e21061034e28e0c Mon Sep 17 00:00:00 2001 From: Steven Palma Date: Tue, 30 Jun 2026 15:15:07 +0200 Subject: [PATCH] chore(groot): move cv2 to the top as its in the default install tag --- src/lerobot/policies/groot/processor_groot.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/lerobot/policies/groot/processor_groot.py b/src/lerobot/policies/groot/processor_groot.py index 1d4c610b2..9655399d1 100644 --- a/src/lerobot/policies/groot/processor_groot.py +++ b/src/lerobot/policies/groot/processor_groot.py @@ -20,6 +20,7 @@ from dataclasses import dataclass, field, fields, is_dataclass from pathlib import Path from typing import TYPE_CHECKING, Any +import cv2 import numpy as np import torch import torchvision.transforms.v2.functional as tv_functional @@ -1324,13 +1325,6 @@ def _transform_n1_7_image_for_vlm_albumentations( target_h, target_w = image_target_size - try: - import cv2 - except ImportError as exc: - raise ImportError( - "GR00T N1.7 checkpoints with use_albumentations=True require opencv-python-headless." - ) from exc - image_np = np.asarray(image) if image_np.ndim == 2: image_np = np.repeat(image_np[:, :, None], 3, axis=2)