Exemplo n.º 1
0
def imgseq_loader(img_paths):
    from torchvision import get_image_backend
    try:
        if get_image_backend() == 'accimage':
            return [accimage_loader(path) for path in img_paths]
        else:
            return [pil_loader(path) for path in img_paths]
    except Exception as exp:
        print("Exception loading an image in %s:\n%s" %
              (os.path.dirname(img_paths[0]), str(exp)))
        raise exp
Exemplo n.º 2
0
def default_loader(path):
    from torchvision import get_image_backend
    if get_image_backend() == 'accimage':
        return accimage_loader(path)
    else:
        return pil_loader(path)
Exemplo n.º 3
0
 def default_loader(path):
     if get_image_backend() == 'accimage':
         return accimage_loader(path)
     else:
         return pil_loader(path)