-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.py
53 lines (41 loc) · 1.19 KB
/
config.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
53
import os
import logging
import numpy as np
def create_logger(name, level=logging.DEBUG):
logger = logging.getLogger(name)
logger.setLevel(level)
stdout_handler = logging.StreamHandler()
stdout_handler.setLevel(level)
stdout_handler.setFormatter(
logging.Formatter(
'[%(name)s:%(filename)s:%(lineno)d] - [%(process)d] - %(asctime)s - %(levelname)s - %(message)s'
)
)
logger.addHandler(stdout_handler)
return logger
LOGGER = create_logger("IMAGE-SEGMENTATION")
ROOT_DIRECTORY = os.path.dirname(os.path.realpath(__file__))
KERNEL_VERTICAL = np.array(
[
[-1, 0, 1],
[-2, 0, 2],
[-1, 0, 1]
],
np.float32
)
KERNEL_HORIZONTAL = np.array(
[
[1, 2, 1],
[0, 0, 0],
[-1, -2, -1]
],
np.float32
)
LAPLACIAN = np.array(
[
[1, 1, 1],
[1, -8, 1],
[1, 1, 1]
],
np.float32
)