dylan-plummer commited on
Commit
f13d8aa
·
1 Parent(s): d6e1889

shorten example

Browse files
Files changed (2) hide show
  1. app.py +2 -2
  2. hls_download.py +2 -1
app.py CHANGED
@@ -51,7 +51,7 @@ def sigmoid(x):
51
  return 1 / (1 + np.exp(-x))
52
 
53
 
54
- @spaces.GPU(duration=120)
55
  def inference(stream_url, start_time, end_time, count_only_api, api_key,
56
  img_size=288, seq_len=64, stride_length=32, stride_pad=3, batch_size=4,
57
  miss_threshold=0.8, marks_threshold=0.5, median_pred_filter=True, center_crop=True, both_feet=True,
@@ -398,7 +398,7 @@ with gr.Blocks(theme='WeixuanYuan/Soft_dark') as demo:
398
  # ]
399
 
400
  gr.Examples(examples=[
401
- ['https://hiemdall-dev2.azurewebsites.net/api/playlist/rec_rd2FAyUo/vod', '00:43:20', '00:44:00'],
402
  #[os.path.join(os.path.dirname(__file__), "files", "train14.mp4")],
403
  #[os.path.join(os.path.dirname(__file__), "files", "train_17.mp4")],
404
  #[os.path.join(os.path.dirname(__file__), "files", "train13.mp4")],
 
51
  return 1 / (1 + np.exp(-x))
52
 
53
 
54
+ @spaces.GPU()
55
  def inference(stream_url, start_time, end_time, count_only_api, api_key,
56
  img_size=288, seq_len=64, stride_length=32, stride_pad=3, batch_size=4,
57
  miss_threshold=0.8, marks_threshold=0.5, median_pred_filter=True, center_crop=True, both_feet=True,
 
398
  # ]
399
 
400
  gr.Examples(examples=[
401
+ ['https://hiemdall-dev2.azurewebsites.net/api/playlist/rec_rd2FAyUo/vod', '00:43:10', '00:43:40'],
402
  #[os.path.join(os.path.dirname(__file__), "files", "train14.mp4")],
403
  #[os.path.join(os.path.dirname(__file__), "files", "train_17.mp4")],
404
  #[os.path.join(os.path.dirname(__file__), "files", "train13.mp4")],
hls_download.py CHANGED
@@ -20,13 +20,14 @@ def download_clips(stream_url, out_dir, start_time, end_time, resize=True):
20
  print(f"yt-dlp output: {e.output}")
21
  return None
22
 
23
- if resize:
24
  ffmpeg_cmd = [
25
  'ffmpeg',
26
  '-i', tmp_file,
27
  '-c:v', 'libx264',
28
  '-preset', 'veryfast',
29
  '-crf', '23',
 
30
  '-maxrate', '2M',
31
  '-bufsize', '4M',
32
  '-vf', f"scale=-2:360",
 
20
  print(f"yt-dlp output: {e.output}")
21
  return None
22
 
23
+ if resize: # resize and convert to 30 fps
24
  ffmpeg_cmd = [
25
  'ffmpeg',
26
  '-i', tmp_file,
27
  '-c:v', 'libx264',
28
  '-preset', 'veryfast',
29
  '-crf', '23',
30
+ '-r', '30',
31
  '-maxrate', '2M',
32
  '-bufsize', '4M',
33
  '-vf', f"scale=-2:360",