Skip to content

Instantly share code, notes, and snippets.

@MoePus
Created June 20, 2018 12:27
Show Gist options
  • Save MoePus/502a41d7353642062a872a8a1ce67000 to your computer and use it in GitHub Desktop.
Save MoePus/502a41d7353642062a872a8a1ce67000 to your computer and use it in GitHub Desktop.
AiDenoiser Caller
import os,sys
import subprocess
if len(sys.argv) <2:
exit()
rootdir = sys.argv[1]
dedir = (rootdir if rootdir[-1] not in ["\\",'/'] else rootdir[0:-1])+"_denoised"
try:
os.mkdir(dedir)
except Exception as e:
pass
list = os.listdir(rootdir)
for i in range(0,len(list)):
path = os.path.join(rootdir,list[i])
if os.path.isfile(path):
subprocess.call(["denoiser","-i",path,"-o",os.path.join(dedir,list[i])])
print(".",end="")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment