code: def create_gif(frames, gif_name, duration=2):
      """Create gif through imageio.
  
      Args:
          frames (list[ndarray]): Image frames
          gif_name (str): Saved gif name
          duration (int): Display interval (s),
              Default: 2
      """
      if imageio is None:
          raise RuntimeError(
              "imageio is not installed,"
              "Please use “pip install imageio” to install"
          )
      imageio.mimsave(gif_name, frames, "GIF", duration=duration)
  
file_path: mmdetection/demo/create_result_gif.py
imports: import argparse
  import os
  import os.path
  import matplotlib.patches
  import matplotlib.pyplot
  import mmcv
  import numpy
  from mmengine.utils import scandir
label_desc: Use image node_id 3 for calling a global function with example usage: create_gif(frames, gif_name, duration) without return types