-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtest.py
32 lines (26 loc) · 818 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/evn python
#coding=utf-8
import os
import tqdm
import numpy as np
import func as fc
def testByDir(srcDir,outDir):
noiseModel = np.load('model/jointDistribution.npy',allow_pickle=True).item()
names = os.listdir(srcDir)
for name in tqdm.tqdm(names):
path = os.path.join(srcDir,name)
im,wb = fc.loadRawDng(path)
nsim,fac = fc.getNoisePair(noiseModel,im,'T1pro')
fc.showSample(nsim,im,wb,outDir)
return
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-s','--srcDir',\
help='source image dir')
parser.add_argument('-o','--outDir',\
help='output image dir')
args = parser.parse_args()
srcDir = args.srcDir
outDir = args.outDir
testByDir(srcDir,outDir)