ziqiangao commited on
Commit
c6dfd57
·
verified ·
1 Parent(s): 12bad8b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -298,7 +298,7 @@ def main(file, name, fps=30, res: tuple = (1280, 720), oscres=512, sr=11025, lyr
298
  print('Frame Count: ' + str(num_frames))
299
  print('Segments per frame: ' + str(oscres))
300
  print('-'*50)
301
- start_progress("Rendering:")
302
  try:
303
  with Pool(cpu_count()-1) as pool:
304
  num_frames = len(samples_array) // (sr // fps)
@@ -306,12 +306,12 @@ def main(file, name, fps=30, res: tuple = (1280, 720), oscres=512, sr=11025, lyr
306
  for _ in pool.imap_unordered(render_frame, params):
307
  iii += 1 # Increment frame count for progress
308
  p((iii, num_frames), desc="Rendering Frames")
309
- progress(iii/num_frames)
310
 
311
  except Exception as e:
312
  raise gr.Error("Something went wrong whilst rendering")
313
  finally:
314
- end_progress()
315
 
316
  p = gr.Progress()
317
  p(0, desc="Compiling video")
@@ -349,7 +349,7 @@ def main(file, name, fps=30, res: tuple = (1280, 720), oscres=512, sr=11025, lyr
349
  # Regular expression to match frame information
350
  frame_re = re.compile(r"frame=\s*(\d+)")
351
  p = gr.Progress()
352
- start_progress('Compliling video')
353
  while True:
354
  output = process.stderr.readline()
355
  if output == '' and process.poll() is not None:
@@ -360,11 +360,11 @@ def main(file, name, fps=30, res: tuple = (1280, 720), oscres=512, sr=11025, lyr
360
  if match:
361
  frame = match.group(1)
362
  p((int(frame), num_frames), desc="Compiling Video")
363
- progress(int(frame)/num_frames)
364
 
365
  # Wait for the process to complete
366
  process.wait()
367
- end_progress()
368
  print('-'*50)
369
  return f"{name}.mp4", haslyrics
370
 
 
298
  print('Frame Count: ' + str(num_frames))
299
  print('Segments per frame: ' + str(oscres))
300
  print('-'*50)
301
+ #start_progress("Rendering:")
302
  try:
303
  with Pool(cpu_count()-1) as pool:
304
  num_frames = len(samples_array) // (sr // fps)
 
306
  for _ in pool.imap_unordered(render_frame, params):
307
  iii += 1 # Increment frame count for progress
308
  p((iii, num_frames), desc="Rendering Frames")
309
+ #progress(iii/num_frames)
310
 
311
  except Exception as e:
312
  raise gr.Error("Something went wrong whilst rendering")
313
  finally:
314
+ #end_progress()
315
 
316
  p = gr.Progress()
317
  p(0, desc="Compiling video")
 
349
  # Regular expression to match frame information
350
  frame_re = re.compile(r"frame=\s*(\d+)")
351
  p = gr.Progress()
352
+ #start_progress('Compliling video')
353
  while True:
354
  output = process.stderr.readline()
355
  if output == '' and process.poll() is not None:
 
360
  if match:
361
  frame = match.group(1)
362
  p((int(frame), num_frames), desc="Compiling Video")
363
+ #progress(int(frame)/num_frames)
364
 
365
  # Wait for the process to complete
366
  process.wait()
367
+ #end_progress()
368
  print('-'*50)
369
  return f"{name}.mp4", haslyrics
370