Dear All,
I am trying to migrate the python based ImageList and PilImageList from here to Libtorch C++:

  
      github.com
  
  
    vita-epfl/openpifpaf/blob/master/openpifpaf/datasets.py 3
import copy
import logging
import os
import torch.utils.data
import torchvision
from PIL import Image

from . import transforms, utils


ANNOTATIONS_TRAIN = 'data-mscoco/annotations/person_keypoints_train2017.json'
ANNOTATIONS_VAL = 'data-mscoco/annotations/person_keypoints_val2017.json'
IMAGE_DIR_TRAIN = 'data-mscoco/images/train2017/'
IMAGE_DIR_VAL = 'data-mscoco/images/val2017/'


def collate_images_anns_meta(batch):
    images = torch.utils.data.dataloader.default_collate([b[0] for b in batch])
    anns = [b[1] for b in batch]
    metas = [b[2] for b in batch]


  This file has been truncated. show original

  
  
    
    
  
  


Most of the examples I found in C++ are for MNIST and not a custom dataset.
Has anyone done something like this before? or is there a build in ImageFolder in C++?
Thanks,