Bläddra i källkod

add split by pun

ming 3 år sedan
förälder
incheckning
d37f511dea
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2 2
      OpenshotService/openshot_video_generator.py

+ 2 - 2
OpenshotService/openshot_video_generator.py

@@ -235,7 +235,7 @@ def call_anchor(fileName,avatar):
     fr.close()
     fw.close()
 
-def parse_script(file_path):
+def parse_script(file_path,gt_list):
     with open(file_path, 'r') as f:
         lines = [line.strip() for line in f]
     lines = adjustSub_by_text_similarity(gt_list,lines)
@@ -441,7 +441,7 @@ def video_gen(name_hash,name,text_content, image_urls,multiLang,avatar):
     Ctr_Autosub.init()
     Ctr_Autosub.generate_subtitles(tmp_video_dir+name_hash+"raw.mp4",'zh',listener_progress,output=tmp_video_dir+name_hash+"script.txt",concurrency=DEFAULT_CONCURRENCY,subtitle_file_format=DEFAULT_SUBTITLE_FORMAT)
     
-    sub_dict = parse_script(tmp_video_dir+name_hash+"script.txt")
+    sub_dict = parse_script(tmp_video_dir+name_hash+"script.txt",split_by_pun(text_content[0]))
     generate_subtitle_image_from_dict(name_hash, sub_dict)
     #sv_path = dir_subtitle + name_hash + '/' + str(script['index'])+'.png'