File size: 882 Bytes
6b11150
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""Detect Himacon (/share) vs ACP (/data/share) data roots."""

from __future__ import annotations

import os
from pathlib import Path


def detect_share_roots() -> tuple[Path, Path]:
    """Return (label_root, video_root). Env overrides win."""
    if os.environ.get("LABEL_ROOT") and os.environ.get("VIDEO_ROOT"):
        return Path(os.environ["LABEL_ROOT"]), Path(os.environ["VIDEO_ROOT"])

    candidates = [
        (Path("/data/share"), "acp"),
        (Path("/share"), "himacon"),
    ]
    for share, _name in candidates:
        label = share / "robotwin2.0-hard-cross-embodiment"
        video = share / "robotwin2.0-hard"
        if label.is_dir() and video.is_dir():
            return label, video

    raise FileNotFoundError(
        "Cannot find robotwin share roots. Set LABEL_ROOT and VIDEO_ROOT, "
        "or mount /data/share (ACP) or /share (Himacon)."
    )