Skip to content

Instantly share code, notes, and snippets.

@jhjin
Created February 13, 2016 02:14
Show Gist options
  • Save jhjin/5cd327be91d94b190f9d to your computer and use it in GitHub Desktop.
Save jhjin/5cd327be91d94b190f9d to your computer and use it in GitHub Desktop.
JPEG sanity check
require('image')
local function iterate(src)
for dir in paths.iterdirs(src) do
local subdir = path.join(src, dir)
print(subdir)
for file in paths.iterfiles(subdir) do
local filepath = path.join(subdir, file)
local ok, img = pcall(image.loadJPG, filepath, 3, 'float')
if not ok then
print(filepath)
end
end
end
end
print('==> train folder')
iterate('/media/SuperSSD/ILSVRC2012/train')
print('==> val folder')
iterate('/media/SuperSSD/ILSVRC2012/val')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment