mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-24 10:16:09 +00:00
chore(groot): move cv2 to the top as its in the default install tag
This commit is contained in:
@@ -20,6 +20,7 @@ from dataclasses import dataclass, field, fields, is_dataclass
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING, Any
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
|
import cv2
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import torch
|
import torch
|
||||||
import torchvision.transforms.v2.functional as tv_functional
|
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
|
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)
|
image_np = np.asarray(image)
|
||||||
if image_np.ndim == 2:
|
if image_np.ndim == 2:
|
||||||
image_np = np.repeat(image_np[:, :, None], 3, axis=2)
|
image_np = np.repeat(image_np[:, :, None], 3, axis=2)
|
||||||
|
|||||||
Reference in New Issue
Block a user