-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path__main__.py
47 lines (42 loc) · 1.07 KB
/
__main__.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import argparse
from config import CONFIG
from dataset_generator import generate_dataset
def setup_args():
parser = argparse.ArgumentParser(
description='Demosaicing dataset generator.'
)
parser.add_argument(
'-e',
action='append',
help='extension of raw images to process',
required=True,
type=str
)
parser.add_argument(
'-s',
help='block size, must be a positive integer',
default=CONFIG['subsampling_block_size'],
type=int
)
parser.add_argument(
'-f',
action='store_true',
help='Forces the deletion of result directories if they already exists. Use carefully',
default=False
)
parser.add_argument(
'-n',
'--add-noise',
action='store_true',
help='Adds noise to resulting images',
default=False
)
parser.add_argument(
'directory',
help='Directory to search raw images in.'
)
return parser.parse_args()
def main():
arguments = setup_args()
generate_dataset(arguments.directory, arguments.e, block_size=arguments.s, force=arguments.f, add_noise=arguments.add_noise)
main()