class_docstr: Dataset used to parallelize the transformation of the dataset via a DataLoader
class_docstr_tok: ["Dataset","used","to","parallelize","the","transformation","of","the","dataset","via","a","DataLoader"]
docstr: Extract the middle frame out of a video clip following
  the protocol of CLIP (https://arxiv.org/pdf/2103.00020.pdf)
  at Appendix A.1
docstr_tok: ["Extract","the","middle","frame","out","of","a","video","clip","following","the","protocol","of","CLIP","(","https",":","\/\/arxiv.org\/pdf\/2103.00020.pdf",")","at","Appendix","A.1"]
code: def _extract_middle_frame(file_path: str) -> Optional[Image.Image]:
      """
      Extract the middle frame out of a video clip following
      the protocol of CLIP (https://arxiv.org/pdf/2103.00020.pdf)
      at Appendix A.1
      """
      with av.open(file_path) as container:
          if len(container.streams.video) > 0:
              nb_frames = container.streams.video[0].frames
              vid_stream = container.streams.video[0]
              for i, frame in enumerate(container.decode(vid_stream)):
                  if i - 1 == nb_frames // 2:
                      return frame.to_image()
          return None
  
file_path: vissl/extra_scripts/datasets/create_k700_data_files.py
imports: import argparse
  import os
  from typing import Optional, Tuple
  import numpy
  from PIL import Image
  from torch.utils.data import DataLoader
  from torchvision.datasets.utils import download_url
  from tqdm import tqdm
  from vissl.utils.download import download_and_extract_archive
  from vissl.utils.io import save_file
label_desc: Use image node_id 3 for calling the KineticsMiddleFrameDataset obj's underlying member method code with example usage: obj._extract_middle_frame(file_path) and returns: None, frame