chore(groot): move cv2 to the top as its in the default install tag

This commit is contained in:
Steven Palma
2026-06-30 15:15:07 +02:00
committed by Andy Wrenn
parent 73c3a66d51
commit 86e60499d0
@@ -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)