-
Notifications
You must be signed in to change notification settings - Fork 0
/
temple.py
56 lines (43 loc) · 1.53 KB
/
temple.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
54
55
56
import sys
import argparse
import torch
from PyQt5.QtWidgets import QApplication
import qdarktheme
from MainWindow import SpeechGeneratorWindow
from Utils.FileSystemManager import create_new_project, is_path_not_in_universe
from Utils.ConfigHandle import write_config_dictionary
def main():
parser = argparse.ArgumentParser(
description="Speech Generation Application: Generate speech with specified project, language, and mode",
epilog="Author: Gonçalo Gouveia | Lisbon, PT"
)
parser.add_argument(
'--project', '-p',
type=str,
default='Project',
help='Specify the name of the project'
)
parser.add_argument(
'--theme', '-t',
type=str,
default='light',
choices=['auto', 'light', 'dark'],
help="Specify theme mode ('auto', 'light', or 'dark')"
)
args = parser.parse_args()
print(f'GPU available: {torch.cuda.is_available()}\n')
project_path = f'Projects/{args.project}'
if is_path_not_in_universe(project_path):
print('New Project Created.\n')
create_new_project(args.project)
else:
print('Project found. Continue and Visualize Dataset.\n')
write_config_dictionary(args, torch.cuda.is_available())
qdarktheme.enable_hi_dpi()
app = QApplication(sys.argv)
qdarktheme.setup_theme(args.theme)
window = SpeechGeneratorWindow()
window.show()
sys.exit(app.exec_())
if __name__ == '__main__':
main()