Skip to content

Instantly share code, notes, and snippets.

@szagoruyko
Created May 17, 2016 23:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save szagoruyko/27712564a3f3765c5bfd933b56a21757 to your computer and use it in GitHub Desktop.
Save szagoruyko/27712564a3f3765c5bfd933b56a21757 to your computer and use it in GitHub Desktop.
os.execute('wget http://torch7.s3-website-us-east-1.amazonaws.com/data/svhn.t7.tgz')
os.execute('tar xvzf svhn.t7.tgz')
os.execute('rm svhn.t7.tgz')
local train = torch.load('./housenumbers/train_32x32.t7','ascii')
local extra = torch.load('./housenumbers/extra_32x32.t7','ascii')
local test = torch.load('./housenumbers/test_32x32.t7', 'ascii')
local dataset = {
trainData = {
data = torch.cat(train.X:transpose(3,4), extra.X:transpose(3,4),1),
size = function() return train.X:size(1) + extra.X:size(1) end,
labels = torch.cat(train.y[1], extra.y[1], 1),
},
testData = {
data = test.X:transpose(3,4),
size = function() return test.X:size(1) end,
labels = test.y[1],
}
}
torch.save('svhn.t7',dataset)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment