You might have to write a custom dataset for your case.

  
      pytorch.org
  
  
    

Writing Custom Datasets, DataLoaders and Transforms — PyTorch Tutorials 1.7.1... 35



  
  
    
    
  
  


You can have a look at the code in this repo:

  
      github.com
  
  
    MohsenFayyaz89/PyTorch_Video_Dataset/blob/master/GeneralVideoDataset.py 101
"""
A Simple PyTorch Video Dataset Class for loading videos using PyTorch
Dataloader. This Dataset assumes that video files are Preprocessed
 by being trimmed over time and resizing the frames.


If you find this code useful, please star the repository.
"""

from __future__ import print_function, division

import os
import pickle

import cv2
import numpy as np
import torch
from torch.utils.data import Dataset




  This file has been truncated. show original