JS6969 commited on
Commit
0851c0d
·
verified ·
1 Parent(s): 30139c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -122,8 +122,8 @@ def render_logo_html(px: int = 96) -> str:
122
  <div style="display:flex;align-items:center;gap:16px;">
123
  <img src="data:image/png;base64,{LOGO_B64}" style="height:{px}px;width:auto;" />
124
  <div>
125
- <div style="font-size:1.6rem;font-weight:800;">Bifröst Beam</div>
126
- <div style="opacity:0.8;">Video → Frames → Upscale (Nordic Inspired)</div>
127
  </div>
128
  </div>
129
  <hr>
@@ -570,7 +570,12 @@ def step1_extract(
570
 
571
  frames = sorted(raw_dir.glob(f"{prefix}_*.{out_format}"), key=_natural_key)
572
 
573
- [str(p) for p in frames] # show all extracted frames
 
 
 
 
 
574
  zip_path = work / "frames.zip"
575
  with zipfile.ZipFile(zip_path, "w", zipfile.ZIP_DEFLATED) as zf:
576
  for p in frames:
 
122
  <div style="display:flex;align-items:center;gap:16px;">
123
  <img src="data:image/png;base64,{LOGO_B64}" style="height:{px}px;width:auto;" />
124
  <div>
125
+ <div style="font-size:1.6rem;font-weight:800;">Bifröst Video to Image</div>
126
+ <div style="opacity:0.8;">Video → Frames → Upscale Re-encode</div>
127
  </div>
128
  </div>
129
  <hr>
 
570
 
571
  frames = sorted(raw_dir.glob(f"{prefix}_*.{out_format}"), key=_natural_key)
572
 
573
+ # Adaptive preview
574
+ if len(frames) <= 100:
575
+ gallery = [str(p) for p in frames] # show all if small set
576
+ else:
577
+ gallery = sample_paths(frames, 100) # evenly sample 100
578
+
579
  zip_path = work / "frames.zip"
580
  with zipfile.ZipFile(zip_path, "w", zipfile.ZIP_DEFLATED) as zf:
581
  for p in frames: