use path.exists
This commit is contained in:
parent
c48c3eb017
commit
11ff1d54ce
12
waifu2x.lua
12
waifu2x.lua
|
@ -59,7 +59,7 @@ local function convert_frames(opt)
|
||||||
end
|
end
|
||||||
fp:close()
|
fp:close()
|
||||||
for i = 1, #lines do
|
for i = 1, #lines do
|
||||||
if file_exists(string.format(opt.o, i)) == false then
|
if path.exists(string.format(opt.o, i)) == false then
|
||||||
local x = image_loader.load_float(lines[i])
|
local x = image_loader.load_float(lines[i])
|
||||||
local new_x = nil
|
local new_x = nil
|
||||||
if opt.m == "noise" and opt.noise_level == 1 then
|
if opt.m == "noise" and opt.noise_level == 1 then
|
||||||
|
@ -97,16 +97,6 @@ local function convert_frames(opt)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function file_exists(name)
|
|
||||||
local f=io.open(name,"r")
|
|
||||||
if f~=nil then
|
|
||||||
io.close(f)
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function waifu2x()
|
local function waifu2x()
|
||||||
local cmd = torch.CmdLine()
|
local cmd = torch.CmdLine()
|
||||||
cmd:text()
|
cmd:text()
|
||||||
|
|
Loading…
Reference in a new issue