Spaces:
Sleeping
Sleeping
rogerxavier
commited on
Commit
•
a02077e
1
Parent(s):
b0825a9
Update taskMap.py
Browse files- taskMap.py +47 -47
taskMap.py
CHANGED
@@ -1,47 +1,47 @@
|
|
1 |
-
from task import _0上传遮罩, _1批量顺序上传原始图片到服务器manga, _2发送任务请求一次执行全部流程, \
|
2 |
-
_3检测output_video效果
|
3 |
-
|
4 |
-
bili_meta_data = {
|
5 |
-
"act_reserve_create": 0,
|
6 |
-
"copyright": 1, # 2是转载
|
7 |
-
"source": "",
|
8 |
-
"desc": '點精心设计乳猪份巷',
|
9 |
-
"desc_format_id": 0,
|
10 |
-
"dynamic": "",
|
11 |
-
"interactive": 0,
|
12 |
-
"no_reprint": 1,
|
13 |
-
"open_elec": 0,
|
14 |
-
"origin_state": 0,
|
15 |
-
"subtitles": {
|
16 |
-
"lan": "",
|
17 |
-
"open": 0
|
18 |
-
},
|
19 |
-
"tag": "动漫解说,漫画, 标动画,动漫杂谈,恋爱,吐槽,漫画推荐",
|
20 |
-
"tid": 210,
|
21 |
-
"title": '鬼畜英雄13',
|
22 |
-
"up_close_danmaku": False,
|
23 |
-
"up_close_reply": False,
|
24 |
-
"up_selection_reply": False,
|
25 |
-
"dtime": 0
|
26 |
-
}
|
27 |
-
defaultBaseUrl = 'https://rogerxavier-moviepy-with-manga-test.hf.space'#比如https否则method not allowed
|
28 |
-
# 函数映射简化执行输入
|
29 |
-
# 定义任务函数映射字典
|
30 |
-
task_functions = {
|
31 |
-
"0": _0上传遮罩.upload_mask_to_space,
|
32 |
-
"1": _1批量顺序上传原始图片到服务器manga.upload_manga_to_space,
|
33 |
-
"2": _2发送任务请求一次执行全部流程.task_submit_to_space,
|
34 |
-
"3": _3检测output_video效果.download_output_video
|
35 |
-
}
|
36 |
-
|
37 |
-
# 定义函数名称和参数的元组列表,可以用**的写法将dict传递参数字典给函数
|
38 |
-
tasks_params = {
|
39 |
-
"0": {"baseUrl": defaultBaseUrl, "mask_path": 'mask'},
|
40 |
-
"1": {"baseUrl": defaultBaseUrl, "manga_path": 'manga'},
|
41 |
-
"2": {"baseUrl": defaultBaseUrl,
|
42 |
-
"task_list": ["0filterImage", "1removeMask", "2magiDialogCut", "3mergeDialogToVideo"],
|
43 |
-
"bili_meta": bili_meta_data, "allow_submit":
|
44 |
-
},
|
45 |
-
"3": {"baseUrl": defaultBaseUrl, "save_path": "output_video.mp4"}
|
46 |
-
}
|
47 |
-
|
|
|
1 |
+
from task import _0上传遮罩, _1批量顺序上传原始图片到服务器manga, _2发送任务请求一次执行全部流程, \
|
2 |
+
_3检测output_video效果
|
3 |
+
|
4 |
+
bili_meta_data = {
|
5 |
+
"act_reserve_create": 0,
|
6 |
+
"copyright": 1, # 2是转载
|
7 |
+
"source": "",
|
8 |
+
"desc": '點精心设计乳猪份巷',
|
9 |
+
"desc_format_id": 0,
|
10 |
+
"dynamic": "",
|
11 |
+
"interactive": 0,
|
12 |
+
"no_reprint": 1,
|
13 |
+
"open_elec": 0,
|
14 |
+
"origin_state": 0,
|
15 |
+
"subtitles": {
|
16 |
+
"lan": "",
|
17 |
+
"open": 0
|
18 |
+
},
|
19 |
+
"tag": "动漫解说,漫画, 标动画,动漫杂谈,恋爱,吐槽,漫画推荐",
|
20 |
+
"tid": 210,
|
21 |
+
"title": '鬼畜英雄13',
|
22 |
+
"up_close_danmaku": False,
|
23 |
+
"up_close_reply": False,
|
24 |
+
"up_selection_reply": False,
|
25 |
+
"dtime": 0
|
26 |
+
}
|
27 |
+
defaultBaseUrl = 'https://rogerxavier-moviepy-with-manga-test.hf.space'#比如https否则method not allowed
|
28 |
+
# 函数映射简化执行输入
|
29 |
+
# 定义任务函数映射字典
|
30 |
+
task_functions = {
|
31 |
+
"0": _0上传遮罩.upload_mask_to_space,
|
32 |
+
"1": _1批量顺序上传原始图片到服务器manga.upload_manga_to_space,
|
33 |
+
"2": _2发送任务请求一次执行全部流程.task_submit_to_space,
|
34 |
+
"3": _3检测output_video效果.download_output_video
|
35 |
+
}
|
36 |
+
|
37 |
+
# 定义函数名称和参数的元组列表,可以用**的写法将dict传递参数字典给函数
|
38 |
+
tasks_params = {
|
39 |
+
"0": {"baseUrl": defaultBaseUrl, "mask_path": 'mask'},
|
40 |
+
"1": {"baseUrl": defaultBaseUrl, "manga_path": 'manga'},
|
41 |
+
"2": {"baseUrl": defaultBaseUrl,
|
42 |
+
"task_list": ["0filterImage", "1removeMask", "2magiDialogCut", "3mergeDialogToVideo"],
|
43 |
+
"bili_meta": bili_meta_data, "allow_submit": True
|
44 |
+
},
|
45 |
+
"3": {"baseUrl": defaultBaseUrl, "save_path": "output_video.mp4"}
|
46 |
+
}
|
47 |
+
|