Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,26 +20,13 @@ def tab_func_prompt():
|
|
| 20 |
ref_video_path = None
|
| 21 |
return ref_video_path, 'prompt_mode'
|
| 22 |
|
| 23 |
-
# with open('script.txt', encoding="utf-8") as f:
|
| 24 |
-
# script_text_to_load_results = f.read()
|
| 25 |
-
|
| 26 |
-
# def dataset_func(evt: gr.SelectData):
|
| 27 |
-
# ref_video_path = evt.value[0]
|
| 28 |
-
# print("[dataset_func] ref_video_path: ", ref_video_path)
|
| 29 |
-
# # input_prompt = 'haha'
|
| 30 |
-
# if not os.path.exists(ref_video_path):
|
| 31 |
-
# raise gr.Error(f"The input video {ref_video_path} is not existed!")
|
| 32 |
-
# video_file_name = os.path.basename(ref_video_path)
|
| 33 |
-
# __, input_prompt = myHumanGen.template_video_2_prompt(video_file_name)
|
| 34 |
-
# return ref_video_path,input_prompt
|
| 35 |
-
|
| 36 |
def video_2_prompt_func(ref_video_path):
|
| 37 |
print("[dataset_func] ref_video_path: %s" % ref_video_path)
|
| 38 |
if not os.path.exists(ref_video_path):
|
| 39 |
raise gr.Error(f"The input video {ref_video_path} is not existed!")
|
| 40 |
video_file_name = os.path.basename(ref_video_path)
|
| 41 |
print("[dataset_func] video_file_name: %s" % video_file_name)
|
| 42 |
-
|
| 43 |
print("[dataset_func] input_prompt: %s" % input_prompt)
|
| 44 |
return ref_video_path,input_prompt
|
| 45 |
|
|
|
|
| 20 |
ref_video_path = None
|
| 21 |
return ref_video_path, 'prompt_mode'
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
def video_2_prompt_func(ref_video_path):
|
| 24 |
print("[dataset_func] ref_video_path: %s" % ref_video_path)
|
| 25 |
if not os.path.exists(ref_video_path):
|
| 26 |
raise gr.Error(f"The input video {ref_video_path} is not existed!")
|
| 27 |
video_file_name = os.path.basename(ref_video_path)
|
| 28 |
print("[dataset_func] video_file_name: %s" % video_file_name)
|
| 29 |
+
input_prompt = myHumanGen.template_video_2_prompt(video_file_name)
|
| 30 |
print("[dataset_func] input_prompt: %s" % input_prompt)
|
| 31 |
return ref_video_path,input_prompt
|
| 32 |
|