-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfig_export.py
43 lines (40 loc) · 1.54 KB
/
config_export.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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
#
# ----------------------------------------------------------------------------------------
# CDeep3M -- NCMIR/NBCR, UCSD -- Date: 10/2019
# ----------------------------------------------------------------------------------------
#
# @author: jihyeonje / mhaberl
import os.path
def writecfg(outdir, version, addtl_choices, strength, thirdstrength):
completeName = os.path.abspath(outdir + "/ConfigSettings_v" + str(version) + ".txt")
file = open(completeName, "w")
file.write('Secondary augmentation strength:')
file.write(strength + '\n')
file.write('Tertiary augmentation strength:')
file.write(thirdstrength + '\n')
file.write('0: Original Image \n')
for i in range(1, 8):
file.write(str(i))
file.write(': ')
file.write(str(addtl_choices[i]).split(" ", 2)[1])
file.write('\n')
for i in range(9, 16):
file.write(str(i))
file.write(': ')
file.write(str(addtl_choices[i][0]).split(" ", 2)[1])
file.write(', ')
file.write(str(addtl_choices[i][1]).split(" ", 2)[1])
file.write('\n')
file.close()
def writecfg_den(outdir, version, strength, thirdstrength):
completeName = os.path.abspath(outdir + "/ConfigSettings_v" + str(version) + ".txt")
file = open(completeName, "w")
file.write('Secondary augmentation strength:')
file.write('-1 \n')
file.write('Tertiary augmentation strength:')
file.write(thirdstrength + '\n')
file.write('1-16: denoised and enhanced \n')
file.close()