Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -3,18 +3,7 @@ from src.text_to_speech import text_to_speech
|
|
3 |
from src.image_gen import image_gen
|
4 |
from src.text_to_video import text_to_video
|
5 |
import os
|
6 |
-
def remove_cache(folder_path):
|
7 |
-
if not os.path.exists(folder_path):
|
8 |
-
os.makedirs(folder_path) # Tạo thư mục nếu chưa tồn tại
|
9 |
-
for file_name in os.listdir(folder_path):
|
10 |
-
file_path = os.path.join(folder_path, file_name)
|
11 |
-
if os.path.isfile(file_path): # Kiểm tra nếu là file
|
12 |
-
os.remove(file_path)
|
13 |
def main(file_path = "./data/input/sample.pdf", analysis_level='basic', writting_style='academic', word_lower_limit=100, word_upper_limit = 150, gender = "female", speed = "fast", number_of_images = 3, detail_level="short", perspective="neutral", emotion="sad", time_setting="classic", art_style="realistic", style="anime", color_palette="monochrome"):
|
14 |
-
remove_cache("./audio")
|
15 |
-
remove_cache("./image")
|
16 |
-
remove_cache("./text")
|
17 |
-
remove_cache("./output")
|
18 |
text_processing(file_path = file_path, analysis_level=analysis_level, writting_style=writting_style, word_lower_limit = word_lower_limit, word_upper_limit=word_upper_limit )
|
19 |
text_to_speech(gender = gender, speed = speed)
|
20 |
image_gen(number_of_images = number_of_images, detail_level=detail_level, perspective=perspective, emotion=emotion, time_setting=time_setting, art_style=art_style, style=style, color_palette=color_palette)
|
|
|
3 |
from src.image_gen import image_gen
|
4 |
from src.text_to_video import text_to_video
|
5 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
def main(file_path = "./data/input/sample.pdf", analysis_level='basic', writting_style='academic', word_lower_limit=100, word_upper_limit = 150, gender = "female", speed = "fast", number_of_images = 3, detail_level="short", perspective="neutral", emotion="sad", time_setting="classic", art_style="realistic", style="anime", color_palette="monochrome"):
|
|
|
|
|
|
|
|
|
7 |
text_processing(file_path = file_path, analysis_level=analysis_level, writting_style=writting_style, word_lower_limit = word_lower_limit, word_upper_limit=word_upper_limit )
|
8 |
text_to_speech(gender = gender, speed = speed)
|
9 |
image_gen(number_of_images = number_of_images, detail_level=detail_level, perspective=perspective, emotion=emotion, time_setting=time_setting, art_style=art_style, style=style, color_palette=color_palette)
|