Kavin60606 commited on
Commit
93e90bf
Β·
verified Β·
1 Parent(s): 39c7cdb

Upload multiview.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. multiview.py +407 -0
multiview.py ADDED
@@ -0,0 +1,407 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/venv/main/bin/python3
2
+ """
3
+ multiview.py β€” synthesize teleop-style 3-camera views for the retargeted
4
+ LeRobot v2.1 dataset (method A': keypoint-guided crops), writing the videos
5
+ STRAIGHT INTO the dataset's videos/ tree so it slots in on the go.
6
+
7
+ LOCKED conventions (per user, 2026-07-24):
8
+ observation.images.top = full egocentric frame, square center-crop -> 224
9
+ observation.images.left_wrist = zoom crop tracking the human LEFT-hand grasp point
10
+ observation.images.right_wrist = zoom crop tracking the human RIGHT-hand grasp point
11
+ L/R is ANATOMICAL / as-is: rightThumbTip.. -> right_wrist ; leftThumbTip.. -> left_wrist.
12
+ BOTH wrist views are ALWAYS rendered (both viewpoints must be present) β€” each
13
+ crop tracks its hand's grasp point every frame; only when a hand genuinely
14
+ leaves the image does crop_at zero-pad that region. No forced all-black views.
15
+
16
+ Output matches abc-teleop EXACTLY: 224x224, h264, yuv420p, 30 fps.
17
+
18
+ Episode E (v2.1) -> EgoDex source (category, file-YYY), reconstructed with the
19
+ same ordering to_lerobot_v21.discover() used (sort by category, file index):
20
+ keypoints/intrinsics/pose <- /workspace/ego/<cat>/data/chunk-*/file-YYY.parquet
21
+ frames <- /workspace/ego/<cat>/videos/observation.images.camera/chunk-*/file-YYY.mp4
22
+ Frames 0..T-1 (T = episode length) are prefix-aligned t=0 β€” verified 1:1 with the
23
+ already-shipped observation.images.camera (parquet_rows == video_frames == T).
24
+
25
+ Resumable (results.jsonl = source of truth, carries per-episode image stats used
26
+ by finalize_multiview.py), logged (--log tees to <ds>/multiview.log), pooled.
27
+
28
+ Usage:
29
+ /venv/main/bin/python3 multiview.py --ds /workspace/retargeted_lerobot \
30
+ --ego /workspace/ego --retgt /workspace/retargeted \
31
+ --workers 48 --log [--limit N] [--categories a,b]
32
+ """
33
+ import os, sys, re, io, glob, json, time, argparse, subprocess, signal
34
+ os.environ.setdefault("OMP_NUM_THREADS", "1")
35
+ os.environ.setdefault("OPENBLAS_NUM_THREADS", "1")
36
+ from pathlib import Path
37
+ import numpy as np
38
+ import pyarrow.parquet as pq
39
+ from scipy.ndimage import map_coordinates, gaussian_filter1d
40
+ from PIL import Image
41
+ import multiprocessing as mp
42
+
43
+ # ── constants ────────────────────────────────────────────────────────────────
44
+ FW, FH = 1920, 1080 # source frame size
45
+ OUT = 224 # output view size
46
+ FPS = 30
47
+ CHUNK = 1000
48
+ WRIST_CROP = 620 # px window @1080p tracking the grasp point
49
+ KEYS = ["observation.images.top",
50
+ "observation.images.left_wrist",
51
+ "observation.images.right_wrist"]
52
+ SIDES = {"R": ("rightThumbTip", "rightIndexFingerTip", "rightMiddleFingerTip"),
53
+ "L": ("leftThumbTip", "leftIndexFingerTip", "leftMiddleFingerTip")}
54
+ # per-clip activity gate for a wrist view
55
+ MOTION_MIN = 0.06 # m of total grasp-path travel to count as "used"
56
+ INBOUNDS_MIN = 0.15 # fraction of frames the hand must be inside the frame
57
+ CENTER_SIGMA = 2.0 # gaussian smoothing (frames) of the crop-center track
58
+
59
+ # per-view fixed lens (virtual camera) β€” geometry is content-independent, so the
60
+ # barrel+tilt remap coords are precomputed ONCE below and reused every frame.
61
+ VIEW = { # key: (tilt_deg, barrel_k, color_gain, color_bias)
62
+ "observation.images.top": ( 3.0, 0.00, 1.05, 3.0),
63
+ "observation.images.left_wrist": ( 5.0, 0.12, 1.08, 5.0),
64
+ "observation.images.right_wrist": (-5.0, 0.12, 0.96, -3.0),
65
+ }
66
+
67
+ DS = EGO = RETGT = "" # set in main
68
+
69
+
70
+ # ── precomputed remap coords (barrel∘tilt), one (YS,XS) per view ─────────────
71
+ def _remap_coords(tilt_deg, barrel_k, n=OUT):
72
+ """Source-sampling coords for output pixel (y,x) after resize->barrel->tilt.
73
+ Pixel flow in make_view is R --barrel--> B --tilt--> final, so we compose:
74
+ final[y,x] = B[y, sx_t(x)] = R[ barrel(sx_t(x), y) ]. Returns (YS, XS)."""
75
+ c = (n - 1) / 2.0
76
+ yy, xx = np.mgrid[0:n, 0:n].astype(np.float64)
77
+ # tilt: horizontal perspective shear, sx depends only on x
78
+ d = np.tan(np.radians(tilt_deg)) * n * 0.5
79
+ Xt = (xx - n / 2) * (1 + d / n * (xx / n - 0.5) * 2) + n / 2 # intermediate x
80
+ Yt = yy # tilt keeps y
81
+ # barrel evaluated at (Xt, Yt)
82
+ xn = (Xt - c) / c
83
+ yn = (Yt - c) / c
84
+ f = 1 + barrel_k * (xn * xn + yn * yn)
85
+ XS = xn * f * c + c
86
+ YS = yn * f * c + c
87
+ return YS.astype(np.float32), XS.astype(np.float32)
88
+
89
+ REMAP = {k: _remap_coords(VIEW[k][0], VIEW[k][1]) for k in KEYS}
90
+
91
+
92
+ # ── image ops ────────────────────────────────────────────────────────────────
93
+ def square_center(img):
94
+ h, w = img.shape[:2]; s = min(h, w)
95
+ return img[(h - s) // 2:(h - s) // 2 + s, (w - s) // 2:(w - s) // 2 + s]
96
+
97
+ def crop_at(img, cx, cy, size):
98
+ """Zero-padded square crop centered at (cx,cy). Out-of-frame -> black pixels."""
99
+ h, w = img.shape[:2]; half = size // 2
100
+ x0 = int(round(cx - half)); y0 = int(round(cy - half))
101
+ out = np.zeros((size, size, 3), np.uint8)
102
+ sx0, sy0 = max(0, x0), max(0, y0)
103
+ sx1, sy1 = min(w, x0 + size), min(h, y0 + size)
104
+ if sx1 > sx0 and sy1 > sy0:
105
+ out[sy0 - y0:sy0 - y0 + (sy1 - sy0), sx0 - x0:sx0 - x0 + (sx1 - sx0)] = img[sy0:sy1, sx0:sx1]
106
+ return out
107
+
108
+ def resize224(img):
109
+ return np.asarray(Image.fromarray(img).resize((OUT, OUT), Image.LANCZOS))
110
+
111
+ def apply_lens(img224, key, gain, bias):
112
+ ys, xs = REMAP[key]
113
+ out = np.empty_like(img224)
114
+ for c in range(3):
115
+ out[..., c] = map_coordinates(img224[..., c], (ys, xs), order=3, mode="nearest")
116
+ if gain != 1.0 or bias != 0.0:
117
+ out = np.clip(out.astype(np.float32) * gain + bias, 0, 255).astype(np.uint8)
118
+ return out
119
+
120
+
121
+ # ── geometry ─────────────────────────────────────────────────────────────────
122
+ def _mat(col, fr):
123
+ return np.array(col[fr].as_py(), dtype=np.float64).reshape(4, 4)
124
+
125
+ def grasp_and_project(t, T):
126
+ """Return dict side-> (u[T], v[T], world_g[T,3]) and per-frame K,cam already
127
+ applied. Projection uses EgoDex's per-frame intrinsics + camera pose."""
128
+ Kc = t.column("camera_intrinsics")
129
+ Cc = t.column("observation.state.camera")
130
+ cols = {s: [t.column("observation.state." + n) for n in names]
131
+ for s, names in SIDES.items()}
132
+ out = {}
133
+ for s in SIDES:
134
+ th, ix, md = cols[s]
135
+ g = np.empty((T, 3)); u = np.empty(T); v = np.empty(T)
136
+ for fr in range(T):
137
+ pt = 0.5 * (_mat(th, fr)[:3, 3]
138
+ + 0.7 * _mat(ix, fr)[:3, 3]
139
+ + 0.3 * _mat(md, fr)[:3, 3])
140
+ g[fr] = pt
141
+ K = np.array(Kc[fr].as_py()).reshape(3, 3)
142
+ cam = _mat(Cc, fr)
143
+ Xc = (np.linalg.inv(cam) @ np.append(pt, 1))[:3]
144
+ z = -Xc[2] if Xc[2] != 0 else 1e-6
145
+ u[fr] = K[0, 0] * Xc[0] / z + K[0, 2]
146
+ v[fr] = -K[1, 1] * Xc[1] / z + K[1, 2]
147
+ out[s] = (u, v, g)
148
+ return out
149
+
150
+ HALF = WRIST_CROP // 2 # crop-center bounds so the window stays fully in-frame
151
+
152
+ def hand_track(u, v, g):
153
+ """(active, cu[T], cv[T]). The crop-center track is smoothed AND clamped so the
154
+ WRIST_CROP window always lies fully inside the frame -> the wrist view is ALWAYS
155
+ real scene content, never black. When the hand is in FOV the crop tracks it; when
156
+ the hand leaves FOV the center rides the nearest edge (hand-adjacent workspace).
157
+ `active` is informational only (logging) now that no view is blacked."""
158
+ T = len(u)
159
+ inb = (u >= 0) & (u < FW) & (v >= 0) & (v < FH)
160
+ motion = float(np.linalg.norm(np.diff(g, axis=0), axis=1).sum()) if T > 1 else 0.0
161
+ active = (motion >= MOTION_MIN) and (inb.mean() >= INBOUNDS_MIN)
162
+ cu = np.nan_to_num(u, nan=FW / 2, posinf=FW, neginf=0.0)
163
+ cv = np.nan_to_num(v, nan=FH / 2, posinf=FH, neginf=0.0)
164
+ cu = np.clip(cu, HALF, FW - HALF).astype(np.float64)
165
+ cv = np.clip(cv, HALF, FH - HALF).astype(np.float64)
166
+ if T >= 3:
167
+ cu = gaussian_filter1d(cu, CENTER_SIGMA, mode="nearest")
168
+ cv = gaussian_filter1d(cv, CENTER_SIGMA, mode="nearest")
169
+ cu = np.clip(cu, HALF, FW - HALF)
170
+ cv = np.clip(cv, HALF, FH - HALF)
171
+ return active, cu, cv, inb
172
+
173
+
174
+ # ── running per-view image stats (LeRobot: per-channel, [0,1], shape (3,1,1)) ─
175
+ class Stat:
176
+ def __init__(self):
177
+ self.n = 0
178
+ self.s = np.zeros(3); self.ss = np.zeros(3)
179
+ self.mn = np.full(3, np.inf); self.mx = np.full(3, -np.inf)
180
+ def add(self, frame): # frame uint8 (H,W,3)
181
+ a = frame.reshape(-1, 3).astype(np.float64) / 255.0
182
+ self.n += a.shape[0]
183
+ self.s += a.sum(0); self.ss += (a * a).sum(0)
184
+ self.mn = np.minimum(self.mn, a.min(0)); self.mx = np.maximum(self.mx, a.max(0))
185
+ def finalize(self, T):
186
+ if self.n == 0: # all-black safety
187
+ z = np.zeros((3, 1, 1))
188
+ return {"min": z.tolist(), "max": z.tolist(),
189
+ "mean": z.tolist(), "std": z.tolist(), "count": [T]}
190
+ mean = self.s / self.n
191
+ var = np.maximum(self.ss / self.n - mean * mean, 0.0)
192
+ r = lambda a: a.reshape(3, 1, 1).tolist()
193
+ return {"min": r(self.mn), "max": r(self.mx),
194
+ "mean": r(mean), "std": r(np.sqrt(var)), "count": [T]}
195
+
196
+
197
+ # ── ffmpeg streaming ─────────────────────────────────────────────────────────
198
+ def _readn(f, n):
199
+ buf = bytearray()
200
+ while len(buf) < n:
201
+ chunk = f.read(n - len(buf))
202
+ if not chunk:
203
+ break
204
+ buf += chunk
205
+ return bytes(buf)
206
+
207
+ def _fferr():
208
+ return open(os.environ.get("FFMPEG_LOG", os.devnull), "a")
209
+
210
+
211
+ def open_decoder(vid, T):
212
+ return subprocess.Popen(
213
+ ["ffmpeg", "-v", "error", "-i", vid, "-frames:v", str(T),
214
+ "-f", "rawvideo", "-pix_fmt", "rgb24", "-s", f"{FW}x{FH}", "-"],
215
+ stdout=subprocess.PIPE, stderr=_fferr(), bufsize=FW * FH * 3 * 2)
216
+
217
+ def open_encoder(path):
218
+ Path(path).parent.mkdir(parents=True, exist_ok=True)
219
+ return subprocess.Popen(
220
+ ["ffmpeg", "-y", "-v", "error", "-f", "rawvideo", "-pix_fmt", "rgb24",
221
+ "-s", f"{OUT}x{OUT}", "-r", str(FPS), "-i", "-",
222
+ "-c:v", "libx264", "-pix_fmt", "yuv420p", "-crf", "23",
223
+ "-g", str(FPS), "-preset", "veryfast", "-threads", "1",
224
+ "-f", "mp4", path],
225
+ stdin=subprocess.PIPE, stderr=_fferr())
226
+
227
+
228
+ # ── per-episode work ─────────────────────────────────────────────────────────
229
+ def src_paths(cat, fyy):
230
+ p = glob.glob(f"{EGO}/{cat}/data/chunk-*/{fyy}.parquet")
231
+ v = glob.glob(f"{EGO}/{cat}/videos/observation.images.camera/chunk-*/{fyy}.mp4")
232
+ return (p[0] if p else None), (v[0] if v else None)
233
+
234
+ def out_paths(eidx):
235
+ ci = eidx // CHUNK
236
+ return {k: f"{DS}/videos/chunk-{ci:03d}/{k}/episode_{eidx:06d}.mp4" for k in KEYS}
237
+
238
+ def process(e):
239
+ eidx, cat, fyy, T = e["episode_index"], e["category"], e["fyy"], e["length"]
240
+ t0 = time.time()
241
+ pqf, vid = src_paths(cat, fyy)
242
+ if not pqf or not vid:
243
+ return {"episode_index": eidx, "error": f"missing source ({cat}/{fyy})"}
244
+ outs = out_paths(eidx)
245
+ try:
246
+ cols = ["camera_intrinsics", "observation.state.camera"] + \
247
+ [f"observation.state.{n}" for s in SIDES.values() for n in s]
248
+ t = pq.read_table(pqf, columns=cols)
249
+ Tsrc = t.num_rows
250
+ Tn = min(T, Tsrc)
251
+ proj = grasp_and_project(t, Tn)
252
+ tracks = {}
253
+ for s in SIDES:
254
+ u, v, g = proj[s]
255
+ tracks[s] = hand_track(u, v, g)
256
+
257
+ stats = {k: Stat() for k in KEYS}
258
+ dec = open_decoder(vid, T)
259
+ enc = {k: open_encoder(outs[k] + ".tmp") for k in KEYS}
260
+ frame_bytes = FW * FH * 3
261
+ last = None
262
+ for fr in range(T):
263
+ raw = _readn(dec.stdout, frame_bytes)
264
+ if len(raw) < frame_bytes:
265
+ img = last if last is not None else np.zeros((FH, FW, 3), np.uint8)
266
+ else:
267
+ img = np.frombuffer(raw, np.uint8).reshape(FH, FW, 3)
268
+ last = img
269
+ fi = min(fr, Tn - 1) # keypoints index (prefix-aligned)
270
+
271
+ # top
272
+ g_top, b_top = VIEW[KEYS[0]][2], VIEW[KEYS[0]][3]
273
+ top = apply_lens(resize224(square_center(img)), KEYS[0], g_top, b_top)
274
+
275
+ views = {KEYS[0]: top}
276
+ for key, s in ((KEYS[1], "L"), (KEYS[2], "R")):
277
+ _active, cu, cv, _ = tracks[s]
278
+ # ALWAYS render both wrist views (both viewpoints present) β€”
279
+ # crop tracks the hand's grasp point every frame; if the hand is
280
+ # genuinely off-frame, crop_at zero-pads only that region.
281
+ crop = crop_at(img, cu[fi], cv[fi], WRIST_CROP)
282
+ gn, bs = VIEW[key][2], VIEW[key][3]
283
+ views[key] = apply_lens(resize224(crop), key, gn, bs)
284
+
285
+ for k in KEYS:
286
+ stats[k].add(views[k])
287
+ enc[k].stdin.write(views[k].tobytes())
288
+
289
+ dec.stdout.close(); dec.wait()
290
+ for k in KEYS:
291
+ enc[k].stdin.close(); enc[k].wait()
292
+ os.replace(outs[k] + ".tmp", outs[k]) # atomic publish
293
+
294
+ return {"episode_index": eidx, "category": cat, "length": T,
295
+ "active": {"L": bool(tracks["L"][0]), "R": bool(tracks["R"][0])},
296
+ "stats": {k: stats[k].finalize(T) for k in KEYS},
297
+ "sec": round(time.time() - t0, 2)}
298
+ except Exception as ex:
299
+ for k in KEYS:
300
+ for p in (outs[k] + ".tmp",):
301
+ try: os.remove(p)
302
+ except OSError: pass
303
+ return {"episode_index": eidx, "error": f"{type(ex).__name__}: {ex}"}
304
+
305
+
306
+ # ── mapping (replicate to_lerobot_v21.discover ordering) ─────────────────────
307
+ def build_episodes():
308
+ lengths = {}
309
+ with open(f"{DS}/meta/episodes.jsonl") as f:
310
+ for line in f:
311
+ d = json.loads(line); lengths[d["episode_index"]] = d["length"]
312
+ rows = []
313
+ for h in sorted(glob.glob(f"{RETGT}/*/clip_*/retargeted.hdf5")):
314
+ parts = h.split("/")
315
+ cat, name = parts[-3], parts[-2]
316
+ m = re.search(r"(file-\d+)_ep", name)
317
+ if not m:
318
+ continue
319
+ fyy = m.group(1)
320
+ rows.append({"category": cat, "fyy": fyy, "fileidx": int(fyy.split("-")[1])})
321
+ rows.sort(key=lambda r: (r["category"], r["fileidx"]))
322
+ eps = []
323
+ for i, r in enumerate(rows):
324
+ if i not in lengths: # dataset has fewer episodes than clips
325
+ continue
326
+ eps.append({"episode_index": i, "category": r["category"],
327
+ "fyy": r["fyy"], "length": lengths[i]})
328
+ return eps
329
+
330
+
331
+ def main():
332
+ global DS, EGO, RETGT
333
+ ap = argparse.ArgumentParser()
334
+ ap.add_argument("--ds", default="/workspace/retargeted_lerobot")
335
+ ap.add_argument("--ego", default="/workspace/ego")
336
+ ap.add_argument("--retgt", default="/workspace/retargeted")
337
+ ap.add_argument("--workers", type=int, default=48)
338
+ ap.add_argument("--limit", type=int, default=0)
339
+ ap.add_argument("--categories", default="")
340
+ ap.add_argument("--log", action="store_true")
341
+ args = ap.parse_args()
342
+ DS, EGO, RETGT = args.ds, args.ego, args.retgt
343
+
344
+ logf = None
345
+ if args.log:
346
+ logf = open(f"{DS}/multiview.log", "a", buffering=1)
347
+ def emit(msg):
348
+ print(msg, flush=True)
349
+ if logf: logf.write(msg + "\n")
350
+
351
+ eps = build_episodes()
352
+ if args.categories:
353
+ keep = set(args.categories.split(","))
354
+ eps = [e for e in eps if e["category"] in keep]
355
+ if args.limit:
356
+ eps = eps[:args.limit]
357
+
358
+ # resume: results.jsonl is the source of truth (carries stats for finalize)
359
+ res_path = f"{DS}/multiview_results.jsonl"
360
+ done = set()
361
+ if os.path.exists(res_path):
362
+ with open(res_path) as f:
363
+ for line in f:
364
+ try:
365
+ d = json.loads(line)
366
+ if "stats" in d:
367
+ done.add(d["episode_index"])
368
+ except Exception:
369
+ pass
370
+ todo = [e for e in eps if e["episode_index"] not in done]
371
+
372
+ emit(f"\n=== multiview run {time.strftime('%Y-%m-%d %H:%M:%S')} ===")
373
+ emit(f"episodes={len(eps)} resumed={len(done)} todo={len(todo)} "
374
+ f"workers={args.workers} keys={len(KEYS)} out={OUT}x{OUT} h264")
375
+ if not todo:
376
+ emit("nothing to do β€” all episodes already have results.")
377
+ return
378
+
379
+ res_f = open(res_path, "a", buffering=1)
380
+ t_start = time.time()
381
+ n_ok = n_err = 0
382
+ errs = []
383
+ with mp.Pool(args.workers, maxtasksperchild=200) as pool:
384
+ for i, r in enumerate(pool.imap_unordered(process, todo, chunksize=1), 1):
385
+ res_f.write(json.dumps(r) + "\n")
386
+ eidx = r["episode_index"]
387
+ if "error" in r:
388
+ n_err += 1; errs.append((eidx, r["error"]))
389
+ emit(f" [ERR {r['error'][:40]:40s}] ep{eidx:06d} {i}/{len(todo)}")
390
+ else:
391
+ n_ok += 1
392
+ el = time.time() - t_start
393
+ eta = el / i * (len(todo) - i) / 3600
394
+ a = r.get("active", {})
395
+ tag = ("LR" if a.get("L") and a.get("R") else
396
+ "L-" if a.get("L") else "-R" if a.get("R") else "--")
397
+ emit(f" [ok {tag}] ep{eidx:06d} {r['category'][:14]:14s} "
398
+ f"{r['sec']:5.1f}s {i}/{len(todo)} ETA {eta:4.2f}h")
399
+ res_f.close()
400
+ emit(f"\nDONE: ok={n_ok} err={n_err} in {(time.time()-t_start)/3600:.2f}h")
401
+ for eidx, msg in errs[:15]:
402
+ emit(f" ERR ep{eidx:06d}: {msg}")
403
+ emit("next: /venv/main/bin/python3 finalize_multiview.py --ds " + DS)
404
+
405
+
406
+ if __name__ == "__main__":
407
+ signal.signal(signal.SIGINT, signal.SIG_DFL)