Example #1
0
def vg_collate(data, num_gpus=3, is_train=False, mode='det'):
    assert mode in ('det', 'rel')
    blob = Blob(mode=mode, is_train=is_train, num_gpus=num_gpus,
                batch_size_per_gpu=len(data) // num_gpus)
    for d in data:
        blob.append(d)
    blob.reduce()
    return blob
Example #2
0
def coco_collate(data, num_gpus=3, is_train=False):
    blob = Blob(mode='det',
                is_train=is_train,
                num_gpus=num_gpus,
                batch_size_per_gpu=len(data) // num_gpus)
    for d in data:
        blob.append(d)
    blob.reduce()
    return blob
Example #3
0
 def prepare_batch_img(self, index):
     data = self[index]
     blob = Blob(mode='rel',
                 is_train=True,
                 num_gpus=1,
                 batch_size_per_gpu=1,
                 mrcnn=self.mrcnn,
                 is_cuda=self.is_cuda)
     blob.append(data)
     blob.reduce()
     return blob
Example #4
0
def vg_collate(data,
               num_gpus=1,
               is_train=False,
               mode='det',
               torch_detector=False,
               is_cuda=True):
    assert mode in ('det', 'rel')
    blob = Blob(mode=mode,
                is_train=is_train,
                num_gpus=num_gpus,
                batch_size_per_gpu=len(data) // num_gpus,
                torch_detector=torch_detector,
                is_cuda=is_cuda)
    for d in data:
        blob.append(d)
    blob.reduce()
    return blob