forked from NPRA/image-anonymisation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default_config.yml
166 lines (119 loc) · 6.32 KB
/
default_config.yml
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# ======================================
# Miscellaneous configuration parameters
# ======================================
#: Apply the mask to the output image?
draw_mask: True
#: Delete the original image from the input directory when the masking is completed?
delete_input: False
#: Recompute masks even though a .webp file exists in the output folder.
force_remask: False
#: When `lazy_paths: True`, traverse the file tree during the masking process.
#: Otherwise, all paths will be identified and stored before the masking starts.
lazy_paths: False
#: Number of seconds to wait before (re)trying to access a file/directory which cannot currently be reached. This
#: applies to both reading input files, and writing output files.
file_access_retry_seconds: 10
#: Total number of seconds to wait before giving up on accessing a file/directory which cannot currently be reached.
#: This also applies to both reading input files, and writing output files.
file_access_timeout_seconds: 60
#: Timestamp format. See https://docs.python.org/3.7/library/datetime.html#strftime-strptime-behavior for more
#: information.
datetime_format: "%Y-%m-%d %H.%M.%S"
#: Name of the log file. `{datetime}` will be replaced with a timestamp formatted as `%Y-%m-%d_%H%M%S`. `{hostname}`
#: will be replaced with the host name.
log_file_name: "{datetime}_{hostname}.log"
#: Logging level for the application. This controls the log level for terminal logging and file logging (if it is
#: enabled). Must be one of {"DEBUG", "INFO", "WARNING", "ERROR"}.
log_level: "DEBUG"
#: Version number for the application. Will be written to json files and database.
application_version: "0.1"
#: Formatter for `mappenavn` in the JSON-file. `relative_input_dir` is the path to the folder containing the image,
#: relative to `exif_top_dir` below. For instance, if the image is located at `C:\Foo\Bar\Baz\Hello\World.jpg`, and
#: `exif_top_dir = Bar`, then `relative_input_dir` will be `Baz\Hello`.
exif_mappenavn: "Vegbilder\\{relative_input_dir}"
#: Top directory for `relative_input_dir`. See above for an explanation.
exif_top_dir: TilSladding
# ===================
# File I/O parameters
# ===================
#: Write the EXIF .json file to the output (remote) directory?
remote_json: True
#: Write the EXIF .json file to the input (local) directory?
local_json: False
#: Write the EXIF .json file to the archive directory?
archive_json: False
#: Write mask file to the output (remote) directory?
remote_mask: True
#: Write the mask file to the input (local) directory?
local_mask: False
#: Write mask file to the archive directory?
archive_mask: False
# =====================================
# Parameters for asynchronous execution
# =====================================
#: Enable asynchronous post-processing? When True, the file exports (anonymised image, mask file and JSON file) will be
#: executed asynchronously in order to increase processing speed.
enable_async: True
#: Maximum number of asynchronous workers allowed to be active simultaneously. Should be <= (CPU core count - 1)
max_num_async_workers: 2
# ================================
# Parameters for the masking model
# ================================
#: Type of masking model. Currently, there are three available models with varying speed and accuracy.
#: The slowest model produces the most accurate masks, while the masks from the medium model are slightly worse.
#: The masks from the "Fast" model are currently not recommended due to poor quality. Must be either "Slow", "Medium" or
#: "Fast". "Medium" is recommended.
#: Default: "Medium"
model_type: "Medium"
#: Approximate number of pixels for mask dilation. This will help ensure that an identified object is completely covered
#: by the corresponding mask. Set `mask_dilation_pixels: 0` to disable mask dilation.
#: Default: `4`
mask_dilation_pixels: 4
#: Maximum number of pixels in images to be processed by the masking model. If the number of pixels exceeds this value,
#: it will be resized before the masker is applied. This will NOT change the resolution of the output image.
max_num_pixels: 1000000000
# ===============================================================
# Parameters controlling the appearance of the anonymised regions
# ===============================================================
#: "RGB tuple (0-255) indicating the masking color. Setting this option will override the
#: colors specified below. Example: Setting `mask_color: [50, 50, 50]` will make all masks
#: dark gray.
mask_color: null
#: Blurring coefficient (1-100) which specifies the degree of blurring to apply within the
#: mask. When this parameter is specified, the image will be blurred, and not masked with a
#: specific color. Set `blur: null` to disable blurring, and use colored masks instead.
#: Default: `15`
blur: 15
#: Convert the image to grayscale before blurring? (Ignored if blurring is disabled)
#: Default: `True`
gray_blur: True
#: Normalize the gray level within each mask after blurring? This will make bright colors indistinguishable from dark
#: colors. NOTE: Requires `gray_blur=True`
#: Default: True
normalized_gray_blur: True
# ====================
# E-mail configuration
# ====================
# Note: E-mail sending requires additional configuration. This is documented in the README.
#: Send an email if the program exits abnormally due to an uncaught exception.
uncaught_exception_email: True
#: Send an email if a processing error is encountered, but the program is able to continue
processing_error_email: True
#: Send an email when the anonymisation finishes normally.
finished_email: True
#: Attach the log file to emails?
email_attach_log_file: True
# ======================
# Database configuration
# ======================
# Note: Database writing requires additional configuration. This is documented in the README.
# When `write_exif_to_db: True`, the EXIF data will be written as a row to an Oracle database. The `src.db` module is
# responsible for the database writing.
#: Write the EXIF data to the database?
write_exif_to_db: True
#: Maximum number of rows to accumulate locally before writing all accumulated rows to the database.
db_max_n_accumulated_rows: 100
#: If the number of failed insertions/updates exceeds this number, a RuntimeError will be raised.
db_max_n_errors: 1000
#: If the number of cached rows exceeds this number, a RuntimeError will be raised.
db_max_cache_size: 1000