ford442 commited on
Commit
c0bd8fe
·
verified ·
1 Parent(s): c28d980

Update inference.py

Browse files
Files changed (1) hide show
  1. inference.py +3 -3
inference.py CHANGED
@@ -7,7 +7,7 @@ from diffusers.utils import logging
7
  from typing import Optional, List, Union
8
  import yaml
9
 
10
- import imageio
11
  import json
12
  import numpy as np
13
  import torch
@@ -650,7 +650,7 @@ def infer(
650
  resolution=(height, width, num_frames),
651
  dir=output_dir,
652
  )
653
- imageio.imwrite(output_filename, video_np[0])
654
  else:
655
  output_filename = get_unique_filename(
656
  f"video_output_{i}",
@@ -662,7 +662,7 @@ def infer(
662
  )
663
 
664
  # Write video
665
- with imageio.get_writer(output_filename, fps=fps) as video:
666
  for frame in video_np:
667
  video.append_data(frame)
668
 
 
7
  from typing import Optional, List, Union
8
  import yaml
9
 
10
+ import imageio.v2 as imageio
11
  import json
12
  import numpy as np
13
  import torch
 
650
  resolution=(height, width, num_frames),
651
  dir=output_dir,
652
  )
653
+ imageio.imwrite(output_filename, video_np[0], quality=100)
654
  else:
655
  output_filename = get_unique_filename(
656
  f"video_output_{i}",
 
662
  )
663
 
664
  # Write video
665
+ with imageio.get_writer(output_filename, fps=fps, quality=10) as video:
666
  for frame in video_np:
667
  video.append_data(frame)
668