MCPcopy Create free account
hub / github.com/MotrixLab/ViMoGen / list_motion_samples

Function list_motion_samples

motion_gating/apply_quality_gate.py:118–138  ·  view source on GitHub ↗
(
    entries: List[Dict[str, Any]], meta_path: Path, eval_field: str
)

Source from the content-addressed store, hash-verified

116
117
118def list_motion_samples(
119 entries: List[Dict[str, Any]], meta_path: Path, eval_field: str
120) -> List[Tuple[int, Path]]:
121 samples: List[Tuple[int, Path]] = []
122 for entry in entries:
123 eval_path = entry.get(eval_field)
124 if eval_path is None:
125 raise KeyError(f"Missing '{eval_field}' in meta entry id={entry.get('id')}")
126 path = resolve_repo_path(meta_path, str(eval_path))
127 if not path.exists():
128 raise FileNotFoundError(f"Missing eval cache: {path}")
129 # Prefer unique global_id; fall back to id if absent
130 motion_id_raw = entry.get("global_id", entry.get("id"))
131 if motion_id_raw is None:
132 raise KeyError("Entry missing both 'global_id' and 'id'")
133 try:
134 motion_id = int(motion_id_raw)
135 except Exception:
136 motion_id = motion_id_raw
137 samples.append((motion_id, path))
138 return samples
139
140
141def compute_metrics_for_dimension(

Callers 1

apply_quality_gateFunction · 0.85

Calls 1

resolve_repo_pathFunction · 0.70

Tested by

no test coverage detected