Upload 2 files
Browse files- processors.py +68 -0
- wording.py +334 -0
processors.py
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import List, Optional
|
| 2 |
+
|
| 3 |
+
import gradio
|
| 4 |
+
|
| 5 |
+
from facefusion import state_manager, wording
|
| 6 |
+
from facefusion.filesystem import get_file_name, resolve_file_paths
|
| 7 |
+
from facefusion.processors.core import get_processors_modules
|
| 8 |
+
from facefusion.uis.core import register_ui_component
|
| 9 |
+
|
| 10 |
+
PROCESSORS_CHECKBOX_GROUP : Optional[gradio.CheckboxGroup] = None
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
label_map = {
|
| 14 |
+
"face_swapper": "人脸替换",
|
| 15 |
+
"face_enhancer": "人脸增强",
|
| 16 |
+
"frame_enhancer": "帧率增强",
|
| 17 |
+
"lip_syncer": "口形同步",
|
| 18 |
+
"emotion_analyzer": "情绪分析",
|
| 19 |
+
"face_debugger": "人脸调试",
|
| 20 |
+
"face_masker": "人脸遮罩",
|
| 21 |
+
"face_landmarker": "特征点检测",
|
| 22 |
+
"age_modifier": "年龄修改",
|
| 23 |
+
"deep_swapper": "深度替换",
|
| 24 |
+
"face_editor": "脸部编辑",
|
| 25 |
+
"expression_restorer": "表情还原",
|
| 26 |
+
"frame_colorizer": "画面上色"
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
def render() -> None:
|
| 31 |
+
global PROCESSORS_CHECKBOX_GROUP
|
| 32 |
+
processors = state_manager.get_item('processors') # e.g., ['face_swapper', 'lip_syncer']
|
| 33 |
+
all_processors = sort_processors(processors) # 排好序的所有模块英文名
|
| 34 |
+
choices = [(label_map.get(p, p), p) for p in all_processors]
|
| 35 |
+
PROCESSORS_CHECKBOX_GROUP = gradio.CheckboxGroup(
|
| 36 |
+
label = wording.get('uis.processors_checkbox_group'),
|
| 37 |
+
# choices = sort_processors(state_manager.get_item('processors')),
|
| 38 |
+
choices = choices,
|
| 39 |
+
value = state_manager.get_item('processors')
|
| 40 |
+
)
|
| 41 |
+
register_ui_component('processors_checkbox_group', PROCESSORS_CHECKBOX_GROUP)
|
| 42 |
+
|
| 43 |
+
|
| 44 |
+
def listen() -> None:
|
| 45 |
+
PROCESSORS_CHECKBOX_GROUP.change(update_processors, inputs = PROCESSORS_CHECKBOX_GROUP, outputs = PROCESSORS_CHECKBOX_GROUP)
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
def update_processors(processors : List[str]) -> gradio.CheckboxGroup:
|
| 49 |
+
for processor_module in get_processors_modules(state_manager.get_item('processors')):
|
| 50 |
+
if hasattr(processor_module, 'clear_inference_pool'):
|
| 51 |
+
processor_module.clear_inference_pool()
|
| 52 |
+
|
| 53 |
+
for processor_module in get_processors_modules(processors):
|
| 54 |
+
if not processor_module.pre_check():
|
| 55 |
+
return gradio.CheckboxGroup()
|
| 56 |
+
|
| 57 |
+
state_manager.set_item('processors', processors)
|
| 58 |
+
sorted_processors = sort_processors(state_manager.get_item('processors'))
|
| 59 |
+
choices = [(label_map.get(p, p), p) for p in sorted_processors]
|
| 60 |
+
return gradio.CheckboxGroup(
|
| 61 |
+
value = state_manager.get_item('processors'),
|
| 62 |
+
choices = choices
|
| 63 |
+
)
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
def sort_processors(processors : List[str]) -> List[str]:
|
| 67 |
+
available_processors = [ get_file_name(file_path) for file_path in resolve_file_paths('facefusion/processors/modules') ]
|
| 68 |
+
return sorted(available_processors, key = lambda processor : processors.index(processor) if processor in processors else len(processors))
|
wording.py
ADDED
|
@@ -0,0 +1,334 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Any, Dict, Optional
|
| 2 |
+
|
| 3 |
+
WORDING : Dict[str, Any] =\
|
| 4 |
+
{
|
| 5 |
+
'conda_not_activated': 'Conda未激活',
|
| 6 |
+
'python_not_supported': 'Python版本不支持,请升级到{version}或更高版本',
|
| 7 |
+
'curl_not_installed': 'CURL未安装',
|
| 8 |
+
'ffmpeg_not_installed': 'FFMpeg未安装',
|
| 9 |
+
'creating_temp': '正在创建临时资源',
|
| 10 |
+
'extracting_frames': '以{resolution}的分辨率和每秒{fps}帧提取帧',
|
| 11 |
+
'extracting_frames_succeed': '帧提取成功',
|
| 12 |
+
'extracting_frames_failed': '帧提取失败',
|
| 13 |
+
'analysing': '分析中',
|
| 14 |
+
'extracting': '提取中',
|
| 15 |
+
'streaming': '流式传输中',
|
| 16 |
+
'processing': '处理中',
|
| 17 |
+
'merging': '合并中',
|
| 18 |
+
'downloading': '下载中',
|
| 19 |
+
'temp_frames_not_found': '未找到临时帧',
|
| 20 |
+
'copying_image': '复制分辨率为{resolution}的图像',
|
| 21 |
+
'copying_image_succeed': '图像复制成功',
|
| 22 |
+
'copying_image_failed': '图像复制失败',
|
| 23 |
+
'finalizing_image': '处理分辨率为{resolution}的图像',
|
| 24 |
+
'finalizing_image_succeed': '图像处理成功',
|
| 25 |
+
'finalizing_image_skipped': '跳过图像处理',
|
| 26 |
+
'merging_video': '合并分辨率为{resolution}并以每秒{fps}帧的视频',
|
| 27 |
+
'merging_video_succeed': '视频合并成功',
|
| 28 |
+
'merging_video_failed': '视频合并失败',
|
| 29 |
+
'skipping_audio': '跳过音频',
|
| 30 |
+
'replacing_audio_succeed': '音频替换成功',
|
| 31 |
+
'replacing_audio_skipped': '跳过音频替换',
|
| 32 |
+
'restoring_audio_succeed': '音频恢复成功',
|
| 33 |
+
'restoring_audio_skipped': '跳过音频恢复',
|
| 34 |
+
'clearing_temp': '清理临时资源',
|
| 35 |
+
'processing_stopped': '处理已停止',
|
| 36 |
+
'processing_image_succeed': '图像处理在{seconds}秒内成功完成',
|
| 37 |
+
'processing_image_failed': '图像处理失败',
|
| 38 |
+
'processing_video_succeed': '视频处理在{seconds}秒内成功完成',
|
| 39 |
+
'processing_video_failed': '视频处理失败',
|
| 40 |
+
'choose_image_source': '选择一个源图像',
|
| 41 |
+
'choose_audio_source': '选择一个源音频',
|
| 42 |
+
'choose_video_target': '选择一个目标视频',
|
| 43 |
+
'choose_image_or_video_target': '选择一个目标图像或视频',
|
| 44 |
+
'specify_image_or_video_output': '指定输出图像或视频的目录',
|
| 45 |
+
'match_target_and_output_extension': '匹配目标和输出扩展名',
|
| 46 |
+
'no_source_face_detected': '未检测到源面部',
|
| 47 |
+
'processor_not_loaded': '处理器{processor}无法加载',
|
| 48 |
+
'processor_not_implemented': '处理器{processor}未正确实现',
|
| 49 |
+
'ui_layout_not_loaded': 'UI布局{ui_layout}无法加载',
|
| 50 |
+
'ui_layout_not_implemented': 'UI布局{ui_layout}未正确实现',
|
| 51 |
+
'stream_not_loaded': '流{stream_mode}无法加载',
|
| 52 |
+
'stream_not_supported': '不支持的流',
|
| 53 |
+
'job_created': '作业{job_id}已创建',
|
| 54 |
+
'job_not_created': '作业{job_id}未创建',
|
| 55 |
+
'job_submitted': '作业{job_id}已提交',
|
| 56 |
+
'job_not_submitted': '作业{job_id}未提交',
|
| 57 |
+
'job_all_submitted': '所有作业已提交',
|
| 58 |
+
'job_all_not_submitted': '所有作业未提交',
|
| 59 |
+
'job_deleted': '作业 {job_id} 已删除',
|
| 60 |
+
'job_not_deleted': '作业 {job_id} 未删除',
|
| 61 |
+
'job_all_deleted': '所有作业已删除',
|
| 62 |
+
'job_all_not_deleted': '未删除任何作业',
|
| 63 |
+
'job_step_added': '步骤已添加到作业 {job_id}',
|
| 64 |
+
'job_step_not_added': '步骤未添加到作业 {job_id}',
|
| 65 |
+
'job_remix_step_added': '步骤 {step_index} 已从作业 {job_id} 重混',
|
| 66 |
+
'job_remix_step_not_added': '步骤 {step_index} 未从作业 {job_id} 重混',
|
| 67 |
+
'job_step_inserted': '步骤 {step_index} 已插入到作业 {job_id}',
|
| 68 |
+
'job_step_not_inserted': '步骤 {step_index} 未插入到作业 {job_id}',
|
| 69 |
+
'job_step_removed': '步骤 {step_index} 已从作业 {job_id} 移除',
|
| 70 |
+
'job_step_not_removed': '步骤 {step_index} 未从作业 {job_id} 移除',
|
| 71 |
+
'running_job': '正在运行排队作业 {job_id}',
|
| 72 |
+
'running_jobs': '正在运行所有排队作业',
|
| 73 |
+
'retrying_job': '正在重试失败的作业 {job_id}',
|
| 74 |
+
'retrying_jobs': '正在重试所有失败的作业',
|
| 75 |
+
'processing_job_succeed': '作业 {job_id} 处理成功',
|
| 76 |
+
'processing_jobs_succeed': '所有作业处理成功',
|
| 77 |
+
'processing_job_failed': '作业 {job_id} 处理失败',
|
| 78 |
+
'processing_jobs_failed': '所有作业处理失败',
|
| 79 |
+
'processing_step': '正在处理步骤 {step_current}/{step_total}',
|
| 80 |
+
'validating_hash_succeed': '验证哈希文件 {hash_file_name} 成功',
|
| 81 |
+
'validating_hash_failed': '验证哈希文件 {hash_file_name} 失败',
|
| 82 |
+
'validating_source_succeed': '验证源文件 {source_file_name} 成功',
|
| 83 |
+
'validating_source_failed': '验证源文件 {source_file_name} 失败',
|
| 84 |
+
'deleting_corrupt_source': '正在删除损坏的源文件 {source_file_name}',
|
| 85 |
+
'time_ago_now': '刚刚',
|
| 86 |
+
'time_ago_minutes': '{minutes}分钟前',
|
| 87 |
+
'time_ago_hours': '{hours}小时{minutes}分钟前',
|
| 88 |
+
'time_ago_days': '{days}天{hours}小时{minutes}分钟前',
|
| 89 |
+
'point': '。',
|
| 90 |
+
'comma': ',',
|
| 91 |
+
'colon': ':',
|
| 92 |
+
'question_mark': '?',
|
| 93 |
+
'exclamation_mark': '!',
|
| 94 |
+
'help':
|
| 95 |
+
{
|
| 96 |
+
'install_dependency': '选择要安装的{dependency}版本',
|
| 97 |
+
'skip_conda': '跳过conda环境检查',
|
| 98 |
+
'config_path': '选择覆盖默认值的配置文件',
|
| 99 |
+
'temp_path': '指定临时文件目录',
|
| 100 |
+
'jobs_path': '指定存储作业的目录',
|
| 101 |
+
'source_paths': '选择单个或多个源图像或音频',
|
| 102 |
+
'target_path': '选择单个目标图像或视频',
|
| 103 |
+
'output_path': '指定输出图像或视频的目录',
|
| 104 |
+
'source_pattern': '选择图像或音频的模式',
|
| 105 |
+
'target_pattern': '选择图像或视频的模式',
|
| 106 |
+
'output_pattern': '指定图像或视频的模式',
|
| 107 |
+
'face_detector_model': '选择负责检测面部的模型',
|
| 108 |
+
'face_detector_size': '指定提供给面部检测器的帧大小',
|
| 109 |
+
'face_detector_angles': '指定在检测面部前旋转帧的角度',
|
| 110 |
+
'face_detector_score': '根据置信分过滤检测到的面部',
|
| 111 |
+
'face_landmarker_model': '选择负责检测面部标志点的模型',
|
| 112 |
+
'face_landmarker_score': '根据置信分过滤检测到的面部标志点',
|
| 113 |
+
'face_selector_mode': '使用基于参考的跟踪或简单匹配',
|
| 114 |
+
'face_selector_order': '指定检测到的面部顺序',
|
| 115 |
+
'face_selector_age_start': '根据起始年龄过滤检测到的面部',
|
| 116 |
+
'face_selector_age_end': '根据结束年龄过滤检测到的面部',
|
| 117 |
+
'face_selector_gender': '根据性别过滤检测到的面部',
|
| 118 |
+
'face_selector_race': '根据种族过滤检测到的面部',
|
| 119 |
+
'reference_face_position': '指定用于创建参考面部的位置',
|
| 120 |
+
'reference_face_distance': '指定参考面部与目标面部的期望相似度',
|
| 121 |
+
'reference_frame_number': '指定用于创建参考面部的帧',
|
| 122 |
+
'face_occluder_model': '选择负责遮挡掩码的模型',
|
| 123 |
+
'face_parser_model': '选择负责区域掩码的模型',
|
| 124 |
+
'face_mask_types': '混合和匹配不同的面部遮罩类型(选项:{choices})',
|
| 125 |
+
'face_mask_blur': '指定应用于框遮罩的模糊程度',
|
| 126 |
+
'face_mask_padding': '对框遮罩应用上下左右填充',
|
| 127 |
+
'face_mask_regions': '选择用于区域遮罩的面部特征(选项:{choices})',
|
| 128 |
+
'trim_frame_start': '指定目标视频的起始帧',
|
| 129 |
+
'trim_frame_end': '指定目标视频的结束帧',
|
| 130 |
+
'temp_frame_format': '指定临时资源格式',
|
| 131 |
+
'keep_temp': '处理后保留临时资源',
|
| 132 |
+
'output_image_quality': '指定图像质量,转换为压缩系数',
|
| 133 |
+
'output_image_resolution': '基于目标图像指定图像输出分辨率',
|
| 134 |
+
'output_audio_encoder': '指定用于音频输出的编码器',
|
| 135 |
+
'output_audio_quality': '指定音频质量,该参数决定了音频压缩程度',
|
| 136 |
+
'output_audio_volume': '根据目标视频指定音频音量',
|
| 137 |
+
'output_video_encoder': '指定用于视频输出的编码器',
|
| 138 |
+
'output_video_preset': '平衡快速视频处理和视频文件大小',
|
| 139 |
+
'output_video_quality': '指定视频质量,转换为压缩系数',
|
| 140 |
+
'output_video_resolution': '基于目标视频指定视频输出分辨率',
|
| 141 |
+
'output_video_fps': '基于目标视频指定视频输出帧率',
|
| 142 |
+
'skip_audio': '从目标视频中省略音频',
|
| 143 |
+
'processors': '加载一个或多个处理器。(选项:{choices},...)',
|
| 144 |
+
'age_modifier_model': '选择负责修改年龄的模型',
|
| 145 |
+
'age_modifier_direction': '指定修改年龄的方向',
|
| 146 |
+
'deep_swapper_model': '选择负责换脸的模型',
|
| 147 |
+
'deep_swapper_morph': '在源人脸和目标人脸之间进行变形融合',
|
| 148 |
+
'expression_restorer_model': '选择负责恢复表情的模型',
|
| 149 |
+
'expression_restorer_factor': '从目标面部恢复表情的恢复因子',
|
| 150 |
+
'face_debugger_items': '加载一个或多个处理器(选项:{choices})',
|
| 151 |
+
'face_editor_model': '选择负责编辑面部的模型',
|
| 152 |
+
'face_editor_eyebrow_direction': '指定眉毛方向',
|
| 153 |
+
'face_editor_eye_gaze_horizontal': '指定水平眼睛注视',
|
| 154 |
+
'face_editor_eye_gaze_vertical': '指定垂直眼睛注视',
|
| 155 |
+
'face_editor_eye_open_ratio': '指定眼睛打开的比例',
|
| 156 |
+
'face_editor_lip_open_ratio': '指定嘴唇打开的比例',
|
| 157 |
+
'face_editor_mouth_grim': '指定嘴部紧张程度',
|
| 158 |
+
'face_editor_mouth_pout': '指定嘴部嘟嘴程度',
|
| 159 |
+
'face_editor_mouth_purse': '指定嘴部抿嘴程度',
|
| 160 |
+
'face_editor_mouth_smile': '指定嘴部微笑程度',
|
| 161 |
+
'face_editor_mouth_position_horizontal': '指定嘴部水平位置',
|
| 162 |
+
'face_editor_mouth_position_vertical': '指定嘴部垂直位置',
|
| 163 |
+
'face_editor_head_pitch': '指定头部俯仰角',
|
| 164 |
+
'face_editor_head_yaw': '指定头部偏航���',
|
| 165 |
+
'face_editor_head_roll': '指定头部翻滚角',
|
| 166 |
+
'face_enhancer_model': '选择负责增强面部的模型',
|
| 167 |
+
'face_enhancer_blend': '将增强的部分混合到前一个面部',
|
| 168 |
+
'face_enhancer_weight': '指定应用于人脸的权重程度',
|
| 169 |
+
'face_swapper_model': '选择负责换脸的模型',
|
| 170 |
+
'face_swapper_pixel_boost': '选择换脸的像素增强分辨率',
|
| 171 |
+
'frame_colorizer_model': '选择负责为帧上色的模型',
|
| 172 |
+
'frame_colorizer_blend': '将上色部分混合到前一个帧',
|
| 173 |
+
'frame_colorizer_size': '指定提供给帧上色器的帧大小',
|
| 174 |
+
'frame_enhancer_model': '选择负责增强帧的模型',
|
| 175 |
+
'frame_enhancer_blend': '将增强部分混合到前一个帧',
|
| 176 |
+
'lip_syncer_model': '选择负责同步嘴唇的模型',
|
| 177 |
+
'open_browser': '程序准备好后打开浏览器',
|
| 178 |
+
'ui_layouts': '启动一个或多个UI布局(选项:{choices},...)',
|
| 179 |
+
'ui_workflow': '选择UI工作流',
|
| 180 |
+
'execution_device_id': '指定用于处理的设备',
|
| 181 |
+
'execution_providers': '使用不同的提供者加速模型推理(选项:{choices},...)',
|
| 182 |
+
'execution_thread_count': '指定处理时的并行线程数',
|
| 183 |
+
'execution_queue_count': '指定每个线程处理的帧数',
|
| 184 |
+
'download_providers': '使用不同的选项下载 (选项: {choices}, ...)',
|
| 185 |
+
'download_scope': 'specify the download scope',
|
| 186 |
+
'video_memory_strategy': '平衡快速处理和低显存使用',
|
| 187 |
+
'system_memory_limit': '限制处理时可用的RAM大小',
|
| 188 |
+
'log_level': '调整终端中显示的消息严重级别',
|
| 189 |
+
'run': '运行程序',
|
| 190 |
+
'headless_run': '以无头模式运行程序',
|
| 191 |
+
'batch_run': '以批处理模式运行程序',
|
| 192 |
+
'force_download': '强制自动下载并退出',
|
| 193 |
+
'job_id': '指定作业ID',
|
| 194 |
+
'job_status': '请指定工作状态',
|
| 195 |
+
'step_index': '指定步骤索引',
|
| 196 |
+
'job_list': '按状态列出作业',
|
| 197 |
+
'job_create': '创建一个草稿作业',
|
| 198 |
+
'job_submit': '将草稿作业提交为排队作业',
|
| 199 |
+
'job_submit_all': '将所有草稿作业提交为排队作业',
|
| 200 |
+
'job_delete': '删除草稿、排队、失败或完成的作业',
|
| 201 |
+
'job_delete_all': '删除所有草稿、排队、失败和完成的作业',
|
| 202 |
+
'job_add_step': '向草稿作业添加一个步骤',
|
| 203 |
+
'job_remix_step': '从草稿作业中重新混合以前的步骤',
|
| 204 |
+
'job_insert_step': '向草稿作业插入一个步骤',
|
| 205 |
+
'job_remove_step': '从草稿作业中删除一个步骤',
|
| 206 |
+
'job_run': '运行一个排队作业',
|
| 207 |
+
'job_run_all': '运行所有排队作业',
|
| 208 |
+
'job_retry': '重试一个失败的作业',
|
| 209 |
+
'job_retry_all': '重试所有失败的作业'
|
| 210 |
+
},
|
| 211 |
+
'about':
|
| 212 |
+
{
|
| 213 |
+
'become_a_member': '文字教程',
|
| 214 |
+
'join_our_community': '文字教程',
|
| 215 |
+
'read_the_documentation': '文字教程'
|
| 216 |
+
},
|
| 217 |
+
'uis':
|
| 218 |
+
{
|
| 219 |
+
'age_modifier_direction_slider': '年龄修饰器方向',
|
| 220 |
+
'age_modifier_model_dropdown': '年龄修饰器模型',
|
| 221 |
+
'apply_button': '应用',
|
| 222 |
+
'benchmark_cycles_slider': '基准周期',
|
| 223 |
+
'benchmark_runs_checkbox_group': '基准运行',
|
| 224 |
+
'clear_button': '清除',
|
| 225 |
+
'common_options_checkbox_group': '选项',
|
| 226 |
+
'download_providers_checkbox_group': '下载选项',
|
| 227 |
+
'deep_swapper_model_dropdown': 'DEEP SWAPPER 模型',
|
| 228 |
+
'deep_swapper_morph_slider': 'DEEP SWAPPER 变形',
|
| 229 |
+
'execution_providers_checkbox_group': '执行提供程序',
|
| 230 |
+
'execution_queue_count_slider': '执行队列数',
|
| 231 |
+
'execution_thread_count_slider': '执行线程数',
|
| 232 |
+
'expression_restorer_factor_slider': '表情恢复因子',
|
| 233 |
+
'expression_restorer_model_dropdown': '表情恢复模型',
|
| 234 |
+
'face_debugger_items_checkbox_group': '面部调试器项目',
|
| 235 |
+
'face_detector_angles_checkbox_group': '面部检测角度',
|
| 236 |
+
'face_detector_model_dropdown': '面部检测模型',
|
| 237 |
+
'face_detector_score_slider': '面部检测评分',
|
| 238 |
+
'face_detector_size_dropdown': '面部检测大小',
|
| 239 |
+
'face_editor_eyebrow_direction_slider': '面部编辑器眉毛方向',
|
| 240 |
+
'face_editor_eye_gaze_horizontal_slider': '面部编辑器眼睛视线水平',
|
| 241 |
+
'face_editor_eye_gaze_vertical_slider': '面部编辑器眼睛视线垂直',
|
| 242 |
+
'face_editor_eye_open_ratio_slider': '面部编辑器眼睛开合比',
|
| 243 |
+
'face_editor_head_pitch_slider': '面部编辑器头部俯仰',
|
| 244 |
+
'face_editor_head_roll_slider': '面部编辑器头部滚动',
|
| 245 |
+
'face_editor_head_yaw_slider': '面部编辑器头部偏航',
|
| 246 |
+
'face_editor_lip_open_ratio_slider': '面部编辑器嘴唇开合比',
|
| 247 |
+
'face_editor_model_dropdown': '面部编辑器模型',
|
| 248 |
+
'face_editor_mouth_grim_slider': '面部编辑器嘴巴紧张',
|
| 249 |
+
'face_editor_mouth_position_horizontal_slider': '面部编辑器嘴巴水平位置',
|
| 250 |
+
'face_editor_mouth_position_vertical_slider': '面部编辑器嘴巴垂直位置',
|
| 251 |
+
'face_editor_mouth_pout_slider': '面部编辑器嘴巴撅嘴',
|
| 252 |
+
'face_editor_mouth_purse_slider': '面部编辑器嘴巴抿嘴',
|
| 253 |
+
'face_editor_mouth_smile_slider': '面部编辑器嘴巴微笑',
|
| 254 |
+
'face_enhancer_blend_slider': '面部增强器混合',
|
| 255 |
+
'face_enhancer_model_dropdown': '面部增强器模型',
|
| 256 |
+
'face_enhancer_weight_slider': '面部增强权重',
|
| 257 |
+
'face_landmarker_model_dropdown': '面部标记器模型',
|
| 258 |
+
'face_landmarker_score_slider': '面部标记器评分',
|
| 259 |
+
'face_mask_blur_slider': '面部遮罩模糊',
|
| 260 |
+
'face_mask_padding_bottom_slider': '面部遮罩底部填充',
|
| 261 |
+
'face_mask_padding_left_slider': '面部遮罩左侧填充',
|
| 262 |
+
'face_mask_padding_right_slider': '面部遮罩右侧填充',
|
| 263 |
+
'face_mask_padding_top_slider': '面部遮罩顶部填充',
|
| 264 |
+
'face_mask_regions_checkbox_group': '面部遮罩区域',
|
| 265 |
+
'face_mask_types_checkbox_group': '面部遮罩类型',
|
| 266 |
+
'face_selector_age_range_slider': '面部选择器年龄',
|
| 267 |
+
'face_selector_gender_dropdown': '面部选择器性别',
|
| 268 |
+
'face_selector_mode_dropdown': '面部选择器模式',
|
| 269 |
+
'face_selector_order_dropdown': '面部选择器顺序',
|
| 270 |
+
'face_selector_race_dropdown': '面部选择器种族',
|
| 271 |
+
'face_swapper_model_dropdown': '面部交换器模型',
|
| 272 |
+
'face_swapper_pixel_boost_dropdown': '面部交换器像素增强',
|
| 273 |
+
'face_occluder_model_dropdown': '面部遮挡模型',
|
| 274 |
+
'face_parser_model_dropdown': '人脸解析器模型',
|
| 275 |
+
'frame_colorizer_blend_slider': '帧着色器混合',
|
| 276 |
+
'frame_colorizer_model_dropdown': '帧着色器模型',
|
| 277 |
+
'frame_colorizer_size_dropdown': '帧着色器大小',
|
| 278 |
+
'frame_enhancer_blend_slider': '帧增强器混合',
|
| 279 |
+
'frame_enhancer_model_dropdown': '帧增强器模型',
|
| 280 |
+
'job_list_status_checkbox_group': '作业状态',
|
| 281 |
+
'job_manager_job_action_dropdown': '作业操作',
|
| 282 |
+
'job_manager_job_id_dropdown': '作业 ID',
|
| 283 |
+
'job_manager_step_index_dropdown': '步骤索引',
|
| 284 |
+
'job_runner_job_action_dropdown': '作业操作',
|
| 285 |
+
'job_runner_job_id_dropdown': '作业 ID',
|
| 286 |
+
'lip_syncer_model_dropdown': '唇形同步器模型',
|
| 287 |
+
'log_level_dropdown': '日志级别',
|
| 288 |
+
'output_audio_encoder_dropdown': '输出音频编码器',
|
| 289 |
+
'output_audio_quality_slider': '输出音频质量',
|
| 290 |
+
'output_audio_volume_slider': '输出音频音量',
|
| 291 |
+
'output_image_or_video': '输出',
|
| 292 |
+
'output_image_quality_slider': '输出图像质量',
|
| 293 |
+
'output_image_resolution_dropdown': '输出图像分辨率',
|
| 294 |
+
'output_path_textbox': '输出路径',
|
| 295 |
+
'output_video_encoder_dropdown': '输出视频编码器',
|
| 296 |
+
'output_video_fps_slider': '输出视频帧率',
|
| 297 |
+
'output_video_preset_dropdown': '输出视频预设',
|
| 298 |
+
'output_video_quality_slider': '输出视频质量',
|
| 299 |
+
'output_video_resolution_dropdown': '输出视频分辨率',
|
| 300 |
+
'preview_frame_slider': '预览帧',
|
| 301 |
+
'preview_image': '预览',
|
| 302 |
+
'processors_checkbox_group': '处理器',
|
| 303 |
+
'reference_face_distance_slider': '参考面部距离',
|
| 304 |
+
'reference_face_gallery': '参考面部',
|
| 305 |
+
'refresh_button': '刷新',
|
| 306 |
+
'source_file': '源文件',
|
| 307 |
+
'start_button': '开始',
|
| 308 |
+
'stop_button': '停止',
|
| 309 |
+
'system_memory_limit_slider': '系统内存限制',
|
| 310 |
+
'target_file': '目标文件',
|
| 311 |
+
'temp_frame_format_dropdown': '临时帧格式',
|
| 312 |
+
'terminal_textbox': '终端',
|
| 313 |
+
'trim_frame_slider': '剪裁帧',
|
| 314 |
+
'ui_workflow': 'UI 工作流',
|
| 315 |
+
'video_memory_strategy_dropdown': '视频内存策略',
|
| 316 |
+
'webcam_fps_slider': '摄像头帧率',
|
| 317 |
+
'webcam_image': '摄像头图像',
|
| 318 |
+
'webcam_device_id_dropdown': '网络摄像头设备ID',
|
| 319 |
+
'webcam_mode_radio': '摄像头模式',
|
| 320 |
+
'webcam_resolution_dropdown': '摄像头分辨率'
|
| 321 |
+
}
|
| 322 |
+
}
|
| 323 |
+
|
| 324 |
+
|
| 325 |
+
def get(notation : str) -> Optional[str]:
|
| 326 |
+
current = WORDING
|
| 327 |
+
|
| 328 |
+
for fragment in notation.split('.'):
|
| 329 |
+
if fragment in current:
|
| 330 |
+
current = current.get(fragment)
|
| 331 |
+
if isinstance(current, str):
|
| 332 |
+
return current
|
| 333 |
+
|
| 334 |
+
return None
|