镜像自地址
https://github.com/MINT-SJTU/Evo-RL.git
已同步 2026-11-20 18:17:06 +00:00
fix(ci): resolve quality pre-commit failures on main
- avoid E402 in sarm subtask test via importlib-based lazy module load - update value_infer_viz wording and formatting to satisfy typos/ruff-format - add explicit strict=True for zip to satisfy ruff B905
这个提交包含在:
@ -1,15 +1,15 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
from pathlib import Path
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
|
||||
import numpy as np
|
||||
from scipy.signal import savgol_filter
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
from scipy.signal import savgol_filter
|
||||
from tqdm.auto import tqdm
|
||||
|
||||
from lerobot.datasets.video_utils import decode_video_frames, encode_video_frames
|
||||
from lerobot.datasets.lerobot_dataset import LeRobotDataset
|
||||
from lerobot.datasets.video_utils import decode_video_frames, encode_video_frames
|
||||
|
||||
|
||||
def _smooth_1d(arr: np.ndarray, window: int = 1) -> np.ndarray:
|
||||
@ -31,7 +31,9 @@ def _select_video_key(camera_keys: list[str], requested_video_key: str | None) -
|
||||
raise ValueError("No camera key found in dataset.")
|
||||
if requested_video_key is not None:
|
||||
if requested_video_key not in camera_keys:
|
||||
raise ValueError(f"Unknown video_key '{requested_video_key}'. Available camera keys: {camera_keys}")
|
||||
raise ValueError(
|
||||
f"Unknown video_key '{requested_video_key}'. Available camera keys: {camera_keys}"
|
||||
)
|
||||
return requested_video_key
|
||||
|
||||
for key in camera_keys:
|
||||
@ -53,7 +55,7 @@ def _select_video_keys(
|
||||
return [_select_video_key(camera_keys, requested_video_key)]
|
||||
|
||||
resolved: list[str] = []
|
||||
for raw_key in requested_video_keys.split(','):
|
||||
for raw_key in requested_video_keys.split(","):
|
||||
key = raw_key.strip()
|
||||
if not key:
|
||||
continue
|
||||
@ -348,7 +350,7 @@ def _encode_pil_to_video(
|
||||
fps: int,
|
||||
vcodec: str,
|
||||
) -> None:
|
||||
"""Encode PIL frames directly to video without writing intermediate PNGs."""
|
||||
"""Encode PIL frames directly to video without writing intermediate PNG files."""
|
||||
import av as _av
|
||||
|
||||
video_options, pix_fmt = _get_video_encode_options(vcodec)
|
||||
@ -465,7 +467,7 @@ def _export_single_episode_multiview(
|
||||
y_min, y_max = _get_episode_value_bounds(ep_values)
|
||||
|
||||
all_cam_frames: list[list[Image.Image]] = []
|
||||
for src_path, ts in zip(src_video_paths, episode_timestamps_per_cam):
|
||||
for src_path, ts in zip(src_video_paths, episode_timestamps_per_cam, strict=True):
|
||||
frames = _decode_frames_at_timestamps(
|
||||
video_file=src_path,
|
||||
timestamps_s=ts,
|
||||
|
||||
@ -14,6 +14,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import importlib
|
||||
|
||||
import pytest
|
||||
|
||||
transformers = pytest.importorskip("transformers")
|
||||
@ -23,12 +25,11 @@ if not hasattr(transformers, "Qwen3VLMoeForConditionalGeneration"):
|
||||
allow_module_level=True,
|
||||
)
|
||||
|
||||
from lerobot.data_processing.sarm_annotations.subtask_annotation import (
|
||||
Subtask,
|
||||
SubtaskAnnotation,
|
||||
Timestamp,
|
||||
compute_temporal_proportions,
|
||||
)
|
||||
subtask_annotation = importlib.import_module("lerobot.data_processing.sarm_annotations.subtask_annotation")
|
||||
Subtask = subtask_annotation.Subtask
|
||||
SubtaskAnnotation = subtask_annotation.SubtaskAnnotation
|
||||
Timestamp = subtask_annotation.Timestamp
|
||||
compute_temporal_proportions = subtask_annotation.compute_temporal_proportions
|
||||
|
||||
|
||||
def make_annotation(subtasks: list[tuple[str, int, int]]) -> SubtaskAnnotation:
|
||||
|
||||
在新工单中引用
屏蔽一个用户