-
Notifications
You must be signed in to change notification settings - Fork 29
/
argument.py
52 lines (45 loc) · 1.89 KB
/
argument.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
48
49
50
51
52
import argparse
def parse():
'''
Add arguments.
'''
parser = argparse.ArgumentParser(
description='Bird-Species-Classification-Using-Transfer-Learning')
parser.add_argument('--root_dir', type=str,
default='../dataset/BSDS300/images', help='root directory of dataset')
parser.add_argument('--output_dir', type=str,
default='../checkpoints/', help='directory of saved checkpoints')
parser.add_argument('--num_epochs', type=int,
default=200, help='number of epochs')
parser.add_argument('--D', type=int,
default=6, help='number of dilated convolutional layer')
parser.add_argument('--C', type=int,
default=64, help='kernel size of convolutional layer')
parser.add_argument('--plot', type=bool, default=False,
help='plot loss during training or not')
parser.add_argument('--model', type=str, default='dudncnn',
help='dncnn, udncnn, or dudncnn')
parser.add_argument('--lr', type=float, default=1e-3,
help='learning rate for training')
parser.add_argument('--image_size', type=tuple, default=(180, 180))
parser.add_argument('--test_image_size', type=tuple, default=(320, 320))
parser.add_argument('--batch_size', type=int, default=4)
parser.add_argument('--sigma', type=int, default=30)
return parser.parse_args()
class Args():
'''
For jupyter notebook
'''
def __init__(self):
self.root_dir = '../dataset/BSDS300/images'
self.output_dir = '../checkpoints/'
self.num_epochs = 200
self.D = 6
self.C = 64
self.plot = False
self.model = 'dudncnn'
self.lr = 1e-3
self.image_size = (180, 180)
self.test_image_size = (320, 320)
self.batch_size = 4
self.sigma = 30