Created
February 13, 2016 02:14
-
-
Save jhjin/5cd327be91d94b190f9d to your computer and use it in GitHub Desktop.
JPEG sanity check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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