futurefantasy commited on
Commit
d2121a3
·
verified ·
1 Parent(s): aa7f815

Update scripts/vlac2_release_common.py for __VLAC2_FRAMES_ROOT__ placeholder

Browse files
Files changed (1) hide show
  1. scripts/vlac2_release_common.py +7 -6
scripts/vlac2_release_common.py CHANGED
@@ -23,6 +23,7 @@ LEGACY_PORTABLE_IMAGE_ROOTS = (
23
  GENERATED_MARKER_FILENAME = "_GENERATED"
24
  PUBLIC_BENCHMARK_JSON_NAME = "video_progress_benchmark_file.json"
25
  PUBLIC_RELEASE_ROOT_PLACEHOLDER = "__VLAC2_RELEASE_ROOT__"
 
26
  PUBLIC_BENCHMARK_DIRNAME = "benchmark_data"
27
  LEGACY_BENCHMARK_DIRNAME = "benchmark_json"
28
 
@@ -124,10 +125,10 @@ def portable_frame_path_from_any(raw_frame_path: str | Path) -> Path:
124
 
125
 
126
  def placeholder_frame_path_from_any(raw_frame_path: str | Path) -> str:
127
- return f"{PUBLIC_RELEASE_ROOT_PLACEHOLDER}/{portable_frame_path_from_any(raw_frame_path).as_posix()}"
128
 
129
 
130
- def absolute_frame_path_from_any(raw_frame_path: str | Path, release_root: Path) -> Path:
131
  raw = str(raw_frame_path or "").strip()
132
  if not raw:
133
  raise ValueError("empty frame path")
@@ -136,16 +137,16 @@ def absolute_frame_path_from_any(raw_frame_path: str | Path, release_root: Path)
136
  return path
137
 
138
  parts = _normalized_parts(raw)
139
- if parts and parts[0] == PUBLIC_RELEASE_ROOT_PLACEHOLDER:
140
  parts = parts[1:]
141
 
142
  for portable_root in portable_image_roots():
143
  marker_parts = list(portable_root.parts)
144
  if parts[: len(marker_parts)] == marker_parts:
145
- return release_root.resolve() / Path(*parts)
146
  if parts and parts[0] in KNOWN_DATASET_NAMES:
147
- return release_root.resolve() / PORTABLE_IMAGE_ROOT / Path(*parts)
148
- return release_root.resolve() / Path(*parts)
149
 
150
 
151
  def rewrite_benchmark_image_paths(
 
23
  GENERATED_MARKER_FILENAME = "_GENERATED"
24
  PUBLIC_BENCHMARK_JSON_NAME = "video_progress_benchmark_file.json"
25
  PUBLIC_RELEASE_ROOT_PLACEHOLDER = "__VLAC2_RELEASE_ROOT__"
26
+ PUBLIC_FRAMES_ROOT_PLACEHOLDER = "__VLAC2_FRAMES_ROOT__"
27
  PUBLIC_BENCHMARK_DIRNAME = "benchmark_data"
28
  LEGACY_BENCHMARK_DIRNAME = "benchmark_json"
29
 
 
125
 
126
 
127
  def placeholder_frame_path_from_any(raw_frame_path: str | Path) -> str:
128
+ return f"{PUBLIC_FRAMES_ROOT_PLACEHOLDER}/{dataset_relative_path(raw_frame_path).as_posix()}"
129
 
130
 
131
+ def absolute_frame_path_from_any(raw_frame_path: str | Path, frames_root: Path) -> Path:
132
  raw = str(raw_frame_path or "").strip()
133
  if not raw:
134
  raise ValueError("empty frame path")
 
137
  return path
138
 
139
  parts = _normalized_parts(raw)
140
+ if parts and parts[0] in (PUBLIC_FRAMES_ROOT_PLACEHOLDER, PUBLIC_RELEASE_ROOT_PLACEHOLDER):
141
  parts = parts[1:]
142
 
143
  for portable_root in portable_image_roots():
144
  marker_parts = list(portable_root.parts)
145
  if parts[: len(marker_parts)] == marker_parts:
146
+ return frames_root.resolve() / Path(*parts[len(marker_parts) :])
147
  if parts and parts[0] in KNOWN_DATASET_NAMES:
148
+ return frames_root.resolve() / Path(*parts)
149
+ return frames_root.resolve() / Path(*parts)
150
 
151
 
152
  def rewrite_benchmark_image_paths(