Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OMNIGLOT Dataset #46

Closed
wants to merge 9 commits into from
Closed

OMNIGLOT Dataset #46

wants to merge 9 commits into from

Conversation

ludc
Copy link

@ludc ludc commented Jan 25, 2017

The OMNIGLOT class can be used to load OMNIGLOT. Note that there is no clear train/test in OMNIGLOT so the class returns the whole dataset. Automatic downloading is included


def __getitem__(self, index):
filename=self.all_items[index][0]
path=self.all_items[index][2]+"/"+filename

This comment was marked as off-topic.

This comment was marked as off-topic.

@ludc
Copy link
Author

ludc commented Jan 25, 2017

Hi,

The omniglot dataset has been simplified and now returns pairs of (filename,target). Pairs of (image,target) can be obtained by using the transforms.FilenameToPILImage transformer. A test script has been also proposed

@wohlert
Copy link

wohlert commented Oct 10, 2017

Any chance this will be merged into the repository?

@alykhantejani
Copy link
Contributor

Sorry for the delay on this, I will try to review in the coming days. As some things have changed in the last months, this will likely need some minor modifications @ludc are you still interested in working on this?

@alykhantejani
Copy link
Contributor

@ludc according to https://github.com/brendenlake/omniglot there are two splits: background and evaluation. Perhaps we should add a split param to the constructor which can be background, evaluation and all (defaulting to background perhaps)?

Copy link
Contributor

@alykhantejani alykhantejani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the PR. I've left some inline comments

@@ -27,6 +27,13 @@ def __call__(self, img):
img = t(img)
return img

class FilenameToPILImage(object):

This comment was marked as off-topic.

print("Download finished.")

def find_classes(root_dir):
retour=[]

This comment was marked as off-topic.

return

# download files
try:

This comment was marked as off-topic.


for url in self.urls:
print('== Downloading ' + url)
data = urllib.request.urlopen(url)

This comment was marked as off-topic.

r=root.split('/')
lr=len(r)
retour.append((f,r[lr-2]+"/"+r[lr-1],root))
print("== Found %d items "%len(retour))

This comment was marked as off-topic.

if (f.endswith("png")):
r=root.split('/')
lr=len(r)
retour.append((f,r[lr-2]+"/"+r[lr-1],root))

This comment was marked as off-topic.

def index_classes(items):
idx={}
for i in items:
if (not i[1] in idx):

This comment was marked as off-topic.

- target_transform: how to transform the target
- download: need to download the dataset
'''
def __init__(self, root, transform=None, target_transform=None, download=False):

This comment was marked as off-topic.

def __len__(self):
return len(self.all_items)

def _check_exists(self):

This comment was marked as off-topic.

raise RuntimeError('Dataset not found.'
+ ' You can use download=True to download it')

self.all_items=find_classes(os.path.join(self.root, self.processed_folder))

This comment was marked as off-topic.

@fmassa
Copy link
Member

fmassa commented Jan 30, 2018

Closed in favour of #323

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants