-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinit_conf.py
More file actions
87 lines (83 loc) · 2.13 KB
/
init_conf.py
File metadata and controls
87 lines (83 loc) · 2.13 KB
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
import os
import json
CONF_TEMPLATES = {
"config.json": {
"milvus_host": "127.0.0.1",
"milvus_port": 19530,
"keras_cuda": False,
"ffmpeg_cuda": False,
"downloadDir": "download",
"videoOutDir": os.path.join("static", "video"),
"imgTmpDir": "tmp_images",
"coverDir": os.path.join("static", "img", "cover"),
"logFile": "AnimeBack.log",
"downloadBilibili": {
"queue": {
"seasons": []
},
"default": {
"SESSDATA": "",
"quality": 64,
"audioQuality": 30216,
"presets": [
"ResNetFlat",
"ResNetFeat"
],
"tag": "$seasonId",
"episodes": "^:$",
"override": False
},
},
"downloadSakura": {
"queue": {
"seasons": []
},
"default": {
"presets": [
"ResNetFlat",
"ResNetFeat"
],
"tag": "$seasonId",
"episodes": "^:$",
"override": False
},
},
"process": {
"rate": 5,
"crf": 36,
"resolution": 480,
"removeVideo": True,
"removeFrame": False,
"filteSimlity": 0.85
},
"trainPCA": {
"episodes": [],
"selectNum": 512
}
}
}
DIRS = [
'static',
os.path.join('static', 'json'),
os.path.join('static', 'img'),
os.path.join('static', 'img', 'cover'),
os.path.join('static', 'img', 'upload'),
os.path.join('static', 'video'),
'download',
'tmp_images',
'db',
'pca',
'saved_models'
]
def init():
for i in DIRS:
if not os.path.exists(i):
print('mkdir', i)
os.mkdir(i)
for i in CONF_TEMPLATES:
if not os.path.exists(i):
print("init", i)
f = open(i, 'w')
f.write(json.dumps(CONF_TEMPLATES[i], indent=4))
f.close()
init()