You could customize the collate functions like this 69

  
      github.com
  
  
    CVBox/PyTorchCV/blob/master/datasets/tools/collate_functions.py 69
#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: Donny You (youansheng@gmail.com)


from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

from datasets.tools.data_transformer import DataTransformer


DATA_KEYS_SEQ = ['img', 'label', 'imgscale', 'labelmap', 'maskmap', 'kpts', 'bboxes', 'labels', 'polygons']


class CollateFunctions(object):

    @staticmethod
    def our_collate(batch, data_keys=None, configer=None, trans_dict=None):
        transposed = [list(sample) for sample in zip(*batch)]


  This file has been truncated. show original