class_docstr: ## Sampler class
class_docstr_tok: ["#","#","Sampler","class"]
docstr: Helper function to create a video
docstr_tok: ["Helper","function","to","create","a","video"]
code: def make_video(self, frames, path="video.mp4"):
      """Helper function to create a video"""
      import imageio
  
      # 20 second video
      writer = imageio.get_writer(path, fps=len(frames) // 20)
      # Add each image
      for f in frames:
          f = f.clip(0, 1)
          f = to_pil_image(resize(f, [368, 368]))
          writer.append_data(np.array(f))
      #
      writer.close()
  
file_path: annotated_deep_learning_paper_implementations/labml_nn/diffusion/ddpm/evaluate.py
imports: import numpy
  import torch
  from matplotlib import pyplot
  from torchvision.transforms.functional import to_pil_image, resize
  from labml import experiment, monit
  from labml_nn.diffusion.ddpm import DenoiseDiffusion, gather
  from labml_nn.diffusion.ddpm.experiment import Configs
label_desc: Use image node_id 3 for calling the Sampler obj's underlying member method code with example usage: obj.make_video(frames, path) without return types