Skip to content

Commit

Permalink
rm torchvision
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhang committed Aug 31, 2017
1 parent 0ff21f4 commit d3859fa
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions data.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,6 @@ def pil_loader(path):
with Image.open(f) as img:
return img.convert('RGB')


def accimage_loader(path):
import accimage
try:
return accimage.Image(path)
except IOError:
# Potentially a decoding problem, fall back to PIL.Image
return pil_loader(path)


def default_loader(path):
from torchvision import get_image_backend
if get_image_backend() == 'accimage':
return accimage_loader(path)
else:
return pil_loader(path)


class ImageFolder(data.Dataset):
"""A generic data loader where the images are arranged in this way: ::
Expand All @@ -89,7 +71,7 @@ class ImageFolder(data.Dataset):
"""

def __init__(self, root, transform=None, target_transform=None,
loader=default_loader):
loader=pil_loader):
classes, class_to_idx = find_classes(root)
imgs = make_dataset(root, class_to_idx)
if len(imgs) == 0:
Expand Down

0 comments on commit d3859fa

Please sign in to comment.