-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathi18n.py
More file actions
1681 lines (1483 loc) · 98.4 KB
/
Copy pathi18n.py
File metadata and controls
1681 lines (1483 loc) · 98.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# -*- coding: utf-8 -*-
"""
国际化(i18n)模块
提供多语言支持功能
"""
import os
from typing import Dict, Optional
class I18n:
"""国际化类"""
def __init__(self, default_lang: str = 'zh'):
"""
初始化国际化类
Args:
default_lang: 默认语言 ('zh' 或 'en')
"""
self.default_lang = default_lang
self.current_lang = default_lang
self.translations = {
'zh': {
# 错误消息
'model_file_not_exists': '模型文件不存在!',
'model_file_solution': '请确保模型文件位于: {}\n下载地址: 请查看项目 README 或联系开发者',
'model_size_warning': '模型文件大小异常(太小),可能已损坏或不完整\n建议: 重新下载模型文件',
'sharp_import_error': 'Sharp 模块导入失败: {}',
'sharp_import_solution': '''可能的原因:
1. Sharp 库未安装
2. 模型文件路径错误
3. Python 环境配置不正确
解决方案:
- 检查 model_assets/ 文件夹是否存在
- 重新安装依赖: pip install -r requirements.txt
- 确保使用正确的 Python 环境''',
'model_load_error': '模型加载失败: {}',
'model_load_solution': '''请检查:
1. 模型文件是否完整
2. PyTorch 版本是否兼容
3. 是否有足够的内存/显存
4. Python 环境是否正确配置''',
'gradient_checkpointing_success': '梯度检查点已启用(显存占用将减少,但推理速度可能略微降低)',
'gpu_memory_insufficient': '显存不足,请使用较小的图片',
'gpu_memory_solution': '建议使用小于 1024x1024 的图片,或关闭其他占用显存的程序',
'processing_failed': '处理失败: {}',
'processing_solution': '请尝试重新启动程序或使用较小的图片',
# 日志消息
'model_loading': '模型加载',
'model_file': '模型文件: {}',
'model_file_size': '模型文件大小: {:.2f} MB',
'creating_predictor': '正在创建预测器...',
'loading_model_weights': '正在加载模型权重...',
'loading_weights_to_predictor': '正在加载权重到预测器...',
'model_load_success': '模型加载完成!',
'device_info': '设备: {}',
'applying_gradient_checkpointing': '正在应用梯度检查点...',
'gpu_memory_usage': '显存占用: {:.2f} MB',
'gpu_acceleration_enabled': 'GPU 加速已启用',
'gpu_vendor': 'GPU 厂商: {}',
'gpu_model': 'GPU 型号: {}',
'compute_capability': '计算能力: {}',
'amp_enabled': '[优化] 混合精度推理: 已启用',
'amp_disabled': '[优化] 混合精度推理: 已禁用',
'cudnn_enabled': '[优化] cuDNN Benchmark: 已启用',
'cudnn_disabled': '[优化] cuDNN Benchmark: 已禁用',
'tf32_enabled': '[优化] TensorFloat32: 已启用',
'tf32_disabled': '[优化] TensorFloat32: 已禁用',
'cpu_mode': '使用 CPU 模式',
'cpu_cores': 'CPU 核心数: {}',
'multithreading_enabled': '[优化] 多线程优化: 已启用',
'cache_enabled': '[缓存] 推理缓存: 已启用(最大 {} 条)',
'cache_disabled': '[缓存] 推理缓存: 已禁用',
'service_address': '服务地址: {}',
'auto_browser': '浏览器将自动打开...',
'press_ctrl_c': '按 Ctrl+C 停止服务',
'auto_open_failed': '无法自动打开浏览器: {}',
'manual_access': '请手动访问: {}',
'cleanup_resources': '正在清理资源...',
'gpu_monitoring_stopped': 'GPU 监控已停止',
'gpu_auto_gc_stopped': 'GPU 自动内存监控已停止',
'webhook_client_closed': 'Webhook 客户端已关闭',
'webhook_close_failed': '关闭 Webhook 客户端失败: {}',
'cleanup_complete': '资源清理完成',
'service_stopped': '服务已停止',
'thank_you': '感谢使用 MLSharp!',
'service_start_failed': '服务启动失败: {}',
'input_size_mismatch': '输入尺寸宽度和高度不相等 ({}x{}),模型使用正方形输入',
'input_size_adjusted': '已调整为 {}x{}',
'input_size_exceeds_max': '输入尺寸 {}x{} 超过最大支持尺寸 {}x{}',
'patch_splitting_error': 'SPN 编码器在更大尺寸下会出现补丁分割错误',
'input_size_not_divisible': '输入尺寸 {}x{} 不能被 64 整除',
'adjusted_to': '已调整为 {}x{}',
'input_size_still_exceeds': '调整后的尺寸 {}x{} 仍然超过最大支持尺寸',
'gpu_init': 'GPU 初始化',
'user_specified_mode': '用户指定启动模式: {}',
'auto_detect_mode': '自动检测模式',
'force_cpu_mode': '强制使用 CPU 模式',
'amd_gpu_detected': '检测到 AMD GPU: {}',
'nvidia_gpu_detected': '检测到 NVIDIA GPU: {}',
'intel_gpu_detected': '检测到 Intel GPU: {}',
'unknown_gpu_detected': '检测到未知 GPU: {}',
'cuda_version': 'CUDA/ROCm 版本: {}',
'gpu_count': 'GPU 数量: {}',
'force_nvidia_mode': '强制使用 NVIDIA 模式,但检测到 {} GPU',
'set_nvidia_mode': '已强制设置为 NVIDIA 模式',
'force_amd_mode': '强制使用 AMD 模式,但检测到 {} GPU',
'set_amd_mode': '已强制设置为 AMD 模式',
'compute_capability_info': '计算能力: {}',
'gpu_memory_info': '显存: {:.2f} GB',
'low_vram_warning': '警告: 显存不足 4GB,可能导致性能问题',
'wmi_detection_failed': 'WMI 检测失败: {}',
'rocm_detection_failed': 'ROCm 检测失败: {}',
'cuda_unavailable_cpu_mode': '使用 CPU 模式\n 原因: CUDA/ROCm 不可用',
'amd_no_rocm': '检测到 AMD 显卡,但 PyTorch 未编译 ROCm 支持\n 解决方案: 安装 ROCm 版本的 PyTorch',
'nvidia_no_cuda': '检测到 NVIDIA 显卡,但 CUDA 不可用\n 请检查:\n 1. 是否安装 NVIDIA 显卡驱动\n 2. 显卡是否支持 CUDA\n 3. PyTorch 是否编译了 CUDA 支持',
'intel_gpu': '检测到 Intel 显卡\n Intel GPU 暂不支持 GPU 加速',
'no_supported_gpu': '未检测到支持的 GPU',
'gpu_memory_query_failed': '获取 GPU 内存信息失败: {}',
'gpu_cache_cleared': 'GPU 缓存已清理 - 设备 {}',
'gpu_cache_freed': ' 释放显存: {:.2f} MB',
'gpu_cache_clear_failed': '清理 GPU 缓存失败: {}',
'gpu_garbage_collected': 'GPU 垃圾回收完成 - 设备 {}',
'gpu_memory_recovered': ' 回收显存: {:.2f} MB',
'gpu_gc_failed': 'GPU 垃圾回收失败: {}',
'gpu_memory_high_usage': 'GPU 显存使用率过高: {:.1f}%',
'gpu_memory_total': ' 总显存: {:.2f} MB',
'gpu_memory_used': ' 已用: {:.2f} MB',
'gpu_memory_free': ' 可用: {:.2f} MB',
'gpu_perform_recovery': ' 执行智能内存回收...',
'smart_memory_recovery_failed': '智能内存回收失败: {}',
'gpu_monitoring_not_running': 'GPU 不可用,跳过自动内存监控',
'gpu_monitor_running': '自动内存监控已在运行',
'gpu_monitor_started': 'GPU 自动内存监控已启动 (间隔: {}s, 阈值: {}%)',
'gpu_monitor_exception': '内存监控异常: {}',
'gpu_monitor_stopped': 'GPU 自动内存监控已停止',
'cache_cleared': '缓存已清空',
'cache_status': '缓存状态: {}',
'cache_size_info': '缓存大小: {}/{}',
'cache_hits': '命中次数: {}',
'cache_misses': '未命中次数: {}',
'cache_hit_rate': '命中率: {:.1f}%',
'redis_connected': 'Redis 缓存已连接: {}',
'redis_not_installed': 'redis 模块未安装,Redis 缓存将不可用',
'redis_install_cmd': '安装命令: pip install redis',
'redis_connection_failed': 'Redis 连接失败: {}',
'redis_unavailable': 'Redis 缓存将不可用,使用本地缓存代替',
'redis_cache_cleared': 'Redis 缓存已清空: {} 个键',
'redis_cache_empty': 'Redis 缓存为空',
'webhook_client_init': 'Webhook 客户端已初始化',
'webhook_not_installed': 'httpx 模块未安装,Webhook 功能将不可用',
'webhook_install_cmd': '安装命令: pip install httpx',
'webhook_disabled': 'Webhook 未启用,无法注册',
'webhook_registered': 'Webhook 已注册: {} -> {}',
'webhook_unregistered': 'Webhook 已注销: {}',
'webhook_sent_success': 'Webhook 发送成功: {} -> {}',
'webhook_sent_failed': 'Webhook 发送失败: {} -> {} (状态码: {})',
'cache_hit_info': '缓存命中! PLY保存完成,耗时: {:.2f}s',
'task_completion_time': '处理完成(缓存),总耗时: {:.2f}秒',
'prediction_start': '开始推理...',
'prediction_complete': '推理完成,耗时: {:.2f}秒',
'result_cached_to_redis': '结果已缓存到 Redis',
'ply_saved': 'PLY保存完成,耗时: {:.2f}s',
'task_complete': '处理完成,总耗时: {:.2f}秒',
'rename_failed': '重命名文件失败: {}',
# 系统信息
'system_info': '系统信息',
'os_info': '操作系统: {} {}',
'python_version': 'Python 版本: {}',
'working_directory': '工作目录: {}',
'web_service': 'Web 服务',
'input_size_info': '输入尺寸: {}x{}',
# 性能调优
'performance_tuning': '性能自动调优',
'testing_configurations': '正在测试不同优化配置...',
'test_config': '测试配置: {}',
'config_description': ' 描述: {}',
'avg_inference_time': ' 平均推理时间: {:.3f} 秒',
'test_failed': ' 测试失败: {}',
'tuning_results': '调优结果',
'best_config': '最优配置: {}',
'best_config_desc': ' 描述: {}',
'avg_inference_time_result': ' 平均推理时间: {:.3f} 秒',
'throughput_info': ' 吞吐量: {:.2f} FPS',
'tuning_complete': '性能自动调优完成!',
'config_applied': '已应用最优配置',
'tuning_failed_default': '所有配置测试失败,使用默认配置',
'tuning_failed': '性能自动调优失败: {}',
'use_default_config': '使用默认配置',
'valid_cache_found': '发现有效的性能调优缓存({} 天前)',
'using_cached_config': '使用缓存的性能配置',
'config_name': '配置名称: {}',
'config_description_cached': '描述: {}',
# API响应
'api_cache_cleared': '缓存已清空',
'webhook_not_enabled': 'Webhook 未启用',
'missing_params': '缺少必要参数: event_type 和 url',
'webhook_registered_resp': 'Webhook 已注册: {} -> {}',
# 其他
'amp_only_optimization': '仅启用混合精度推理',
'cudnn_only_optimization': '仅启用 cuDNN 自动调优',
'tf32_only_optimization': '仅启用 TensorFloat32',
'amp_cudnn_optimization': 'AMP 和 cuDNN 自动调优',
'amp_tf32_optimization': 'AMP 和 TensorFloat32',
'all_optimizations': '启用所有优化',
# 进度和状态
'task_processing': '[Task {}] 已保存文件: {}',
'task_image_info': '[Task {}] 图像信息: {}x{}, 焦距: {} (加载耗时: {:.2f}s)',
'task_large_image': '[Task {}] 图片尺寸过大 ({}x{}),可能导致性能问题',
'task_cache_hit': '[Task {}] 缓存命中! PLY保存完成,耗时: {:.2f}s',
'task_cache_complete': '[Task {}] 处理完成(缓存),总耗时: {:.2f}秒',
'task_start_inference': '[Task {}] 开始推理...',
'task_inference_complete': '[Task {}] 推理完成,耗时: {:.2f}秒',
'task_redis_cache': '[Task {}] 结果已缓存到 Redis',
'task_ply_save_complete': '[Task {}] PLY保存完成,耗时: {:.2f}s',
'task_complete_total': '[Task {}] 处理完成,总耗时: {:.2f}秒',
'task_vram_insufficient': '[Task {}] 显存不足: {}',
'task_processing_failed': '[Task {}] 处理失败: {}',
# 配置验证错误
'input_size_error': 'input_size 必须包含 2 个元素',
'input_size_square_error': 'input_size 必须为正方形,当前为 {}x{}',
'input_size_divisible_error': 'input_size 必须能被 64 整除,当前为 {}x{}',
'input_size_max_error': 'input_size 不能超过 {}x{},当前为 {}x{}',
'threshold_range_error': 'auto_gc_threshold 必须在 0-100 之间',
'host_empty_error': 'host 不能为空',
'checkpoint_empty_error': 'checkpoint 不能为空',
'temp_dir_empty_error': 'temp_dir 不能为空',
'redis_url_required': 'Redis 启用时必须提供 url',
# 统计信息
'points_label': 'Points',
'fps_label': 'FPS',
'stat_points': '点云数',
'stat_fps': '帧率',
'ctrl_scale': '缩放',
'ctrl_opacity': '透明度',
'ctrl_exposure': '曝光',
'ctrl_speed': '速度',
'flow_amp': '强度',
'flow_freq': '频率',
'flow_speed': '流速',
'import_main': '导入模型',
'import_sub': '拖拽 .PLY 文件',
'nav_move': '移动',
'nav_lift': '升降',
'nav_fast': '加速',
'nav_look': '视角',
'loading_init': '系统初始化中',
'tutorial_text': '[ WASD ] 飞行与探索',
'loading_processing': '正在处理作品',
'loading_downloading': '正在下载几何数据',
'loading_parsing': '数据解析中...',
'loading_generating': '生成演示模型',
'loading_importing': '正在导入模型',
'loading_download_general': '下载中...',
'btn_flow_tooltip': '散开 / 处理 (湍流效果)',
'btn_download_tooltip': '下载模型 (.ply)',
# 英文标签(在中文环境中保持一致性)
'subtitle_en': 'HIGH FIDELITY VIEWER .01',
'scale_en': 'Scale',
'opacity_en': 'Opacity',
'exposure_en': 'Exposure',
'speed_en': 'Speed',
'amp_en': 'Amp',
'freq_en': 'Freq',
'flow_speed_en': 'Flow Spd',
'import_main_en': 'Import',
'import_sub_en': 'Drag & Drop Image/.PLY',
'move_en': 'Move',
'lift_en': 'Lift',
'fast_en': 'Fast',
'look_en': 'Look',
'init_en': 'INITIALIZING SYSTEM',
'tutorial_en': '[ WASD ] TO FLY & COLLECT',
# 新增:配置加载相关
'load_config_failed': '加载配置文件失败: {}',
'use_default_config_and_args': '使用默认配置和命令行参数',
# 新增:日志标题
'gpu_init_title': 'GPU 初始化',
'cache_stats_title': '缓存统计',
'cached_config_title': '使用缓存的性能配置',
'performance_tuning_title': '性能自动调优',
'tuning_results_title': '调优结果',
'model_loading_title': '模型加载',
'system_info_title': '系统信息',
'web_service_title': 'Web 服务',
'service_stopped_title': '服务已停止',
# 新增:用户指定模式
'user_specified_mode_info': '用户指定启动模式: {}',
# 新增:CUDA/ROCm版本
'cuda_version_info': ' CUDA/ROCm 版本: {}',
# 新增:GPU数量
'gpu_count_info': ' GPU 数量: {}',
# 新增:计算能力
'compute_capability_info_full': ' 计算能力: {}',
# 新增:GPU内存
'gpu_memory_info_full': ' 显存: {:.2f} GB',
# 新增:GC间隔和阈值
'gc_interval_info': ' 检查间隔: {} 秒',
'gc_threshold_info': ' 清理阈值: {}%',
# 新增:默认配置文件
'using_default_config_file': '使用默认配置文件: {}',
# 新增:显存释放
'vram_freed_info': ' 释放显存: {:.2f} MB',
# 新增:显存回收
'vram_recovered_info': ' 回收显存: {:.2f} MB',
# 新增:显存统计
'vram_total_info': ' 总显存: {:.2f} MB',
'vram_used_info': ' 已用: {:.2f} MB',
'vram_free_info': ' 可用: {:.2f} MB',
# 新增:监控启动
'gpu_monitoring_started': 'GPU 自动内存监控已启动 (间隔: {}s, 阈值: {}%)',
# 新增:缓存状态
'cache_enabled_status': '缓存状态: 已启用',
'cache_disabled_status': '缓存状态: 已禁用',
'cache_size_info_full': '缓存大小: {}/{}',
'cache_hits_info': '命中次数: {}',
'cache_misses_info': '未命中次数: {}',
'cache_hit_rate_info': '命中率: {:.1f}%',
# 新增:Redis连接
'redis_connected_info': 'Redis 缓存已连接: {}',
# 新增:Redis清除
'redis_cleared_info': 'Redis 缓存已清空: {} 个键',
# 新增:Webhook
'webhook_registered_info': 'Webhook 已注册: {} -> {}',
'webhook_unregistered_info': 'Webhook 已注销: {}',
'webhook_sent_info': 'Webhook 发送成功: {} -> {}',
# 新增:调优缓存
'tuning_cache_found': '发现有效的性能调优缓存({} 天前)',
# 新增:配置目录
'config_dir_created': '已创建配置目录: {}',
# 新增:配置文件更新
'config_file_updated': '配置文件已存在,更新性能调优缓存: {}',
'config_file_created': '配置文件不存在,自动创建新配置文件: {}',
# 新增:最佳配置
'best_config_name': '配置名称: {}',
'best_config_desc_info': '描述: {}',
# 新增:测试配置
'test_config_info': '测试配置: {}',
'test_config_desc': ' 描述: {}',
'avg_inference_time_info': ' 平均推理时间: {:.3f} 秒',
# 新增:吞吐量
'throughput_info_full': ' 吞吐量: {:.2f} FPS',
# 新增:测试运行
'test_run_info': ' 运行 {}/{}: {:.3f} 秒',
# 新增:模型文件
'model_file_info': '模型文件: {}',
# 新增:设备信息
'device_info_full': '设备: {}',
# 新增:显存使用
'vram_usage_info': '显存占用: {:.2f} MB',
# 新增:任务处理
'task_file_saved': '[Task {}] 已保存文件: {}',
# 新增:任务图像信息
'task_image_info_full': '[Task {}] 图像信息: {}x{}, 焦距: {} (加载耗时: {:.2f}s)',
# 新增:任务缓存命中
'task_cache_hit_info': '[Task {}] 缓存命中! PLY保存完成,耗时: {:.2f}s',
# 新增:任务完成
'task_completion_info': '[Task {}] 处理完成(缓存),总耗时: {:.2f}秒',
# 新增:任务推理
'task_inference_start': '[Task {}] 开始推理...',
'task_inference_complete_info': '[Task {}] 推理完成,耗时: {:.2f}秒',
'task_redis_cache_info': '[Task {}] 结果已缓存到 Redis',
'task_ply_save_info': '[Task {}] PLY保存完成,耗时: {:.2f}s',
'task_complete_info': '[Task {}] 处理完成,总耗时: {:.2f}秒',
# 新增:系统信息
'os_info_full': '操作系统: {} {}',
'python_version_info': 'Python 版本: {}',
'working_directory_info': '工作目录: {}',
'input_size_info_full': '输入尺寸: {}x{}',
# 新增:GPU厂商/型号
'gpu_vendor_info': 'GPU 厂商: {}',
'gpu_model_info': 'GPU 型号: {}',
# 新增:优化状态
'amp_enabled_info': '[优化] 混合精度推理: 已启用',
'amp_disabled_info': '[优化] 混合精度推理: 已禁用',
'cudnn_enabled_info': '[优化] cuDNN Benchmark: 已启用',
'cudnn_disabled_info': '[优化] cuDNN Benchmark: 已禁用',
'tf32_enabled_info': '[优化] TensorFloat32: 已启用',
'tf32_disabled_info': '[优化] TensorFloat32: 已禁用',
# 新增:CPU核心
'cpu_cores_info': 'CPU 核心数: {}',
# 新增:缓存禁用
'cache_disabled_info': '[缓存] 推理缓存: 已禁用',
# 新增:手动访问
'manual_access_info': '请手动访问: {}',
# 新增:CPU优化
'cpu_optimization_enabled': 'CPU 优化已启用({} 核心)',
# 新增:自动GC状态
'auto_gc_enabled': ' 自动垃圾回收: 已启用',
'auto_gc_disabled': ' 自动垃圾回收: 已禁用',
# 新增:cuDNN状态
'cudnn_enabled_status': ' cuDNN Benchmark: 已启用',
'cudnn_disabled_capability': ' cuDNN Benchmark: 已禁用(显卡计算能力不足)',
# 新增:TF32状态
'tf32_enabled_status': ' TensorFloat32: 已启用',
'tf32_disabled_support': ' TensorFloat32: 已禁用(显卡不支持)',
# 新增:AMP状态
'amp_enabled_status': ' 混合精度推理 (AMP): 已启用',
'amp_disabled_capability': ' 混合精度推理 (AMP): 已禁用(显卡计算能力不足)',
# 新增:监控运行
'monitoring_already_running': '自动内存监控已在运行',
# 新增:测试运行失败
'test_run_failed': ' 运行 {}/{} 失败: {}',
# 新增:梯度检查点成功
'grad_checkpoint_enabled': '梯度检查点已启用(显存占用将减少,但推理速度可能略微降低)',
# 新增:Redis缓存启用
'redis_cache_enabled': 'Redis 缓存已启用: {}',
# 新增:Webhook启用
'webhook_enabled': 'Webhook 通知已启用',
# 新增:GPU加速启用
'gpu_accel_enabled': 'GPU 加速已启用',
# 新增:多线程优化
'multithreading_opt_enabled': '[优化] 多线程优化: 已启用',
# 新增:推理缓存
'inference_cache_enabled': '[缓存] 推理缓存: 已启用(最大 {} 条)',
# Logger 类日志格式标签
'log_error': '错误',
'log_solution': '解决方案',
'log_detail_error': '详细错误信息',
'log_exception': '异常',
'log_detail_exception': '详细异常信息',
'log_critical': '严重错误',
'log_emergency_solution': '紧急解决方案',
'log_performance': '性能',
'log_gpu': 'GPU',
'log_cache': '缓存',
# GPU 初始化相关
'gpu_init_failed': '设备初始化失败: {}',
'gpu_memory_management': '\nGPU 内存管理:',
'configure_optimizations': '\n根据显卡能力配置优化:',
'cudnn_enable_failed': ' cuDNN Benchmark: 启用失败 ({})',
'cudnn_not_applicable': ' cuDNN Benchmark: 不适用(非 NVIDIA GPU)',
'tf32_enable_failed': ' TensorFloat32: 启用失败 ({})',
'tf32_not_applicable': ' TensorFloat32: 不适用(非 NVIDIA GPU)',
# GPU 内存管理
'gpu_unavailable_skip_cache': 'GPU 不可用,跳过缓存清理',
'gpu_unavailable_skip_gc': 'GPU 不可用,跳过垃圾回收',
# 命令行参数帮助文本
'arg_mode_help': '启动模式:auto(自动), gpu(GPU), cpu(CPU), nvidia(NVIDIA), amd(AMD)',
'arg_port_help': 'Web 服务端口(默认:8000)',
'arg_host_help': 'Web 服务主机地址(默认:127.0.0.1)',
'arg_no_browser_help': '不自动打开浏览器',
'arg_no_amp_help': '禁用混合精度推理(AMP)',
'arg_no_cudnn_help': '禁用 cuDNN Benchmark',
'arg_config_help': '配置文件路径(支持 YAML 和 JSON)',
'arg_input_size_help': '输入图像尺寸(默认:1536 1536)',
'arg_gradient_help': '启用梯度检查点(减少显存占用,但会略微降低推理速度)',
'arg_segments_help': '梯度检查点分段数 (默认: 3)',
'arg_cache_help': '启用推理缓存(默认:启用)',
'arg_no_cache_help': '禁用推理缓存',
'arg_cache_size_help': '缓存最大条目数(默认:100)',
'arg_clear_cache_help': '启动时清空缓存',
'arg_auto_tune_help': '启用性能自动调优(启动时自动测试并选择最优配置)',
'arg_redis_help': 'Redis 连接 URL(例如:redis://localhost:6379/0)',
'arg_webhook_help': '启用 Webhook 通知',
'arg_auto_gc_help': '启用 GPU 自动垃圾回收(默认:启用)',
'arg_no_auto_gc_help': '禁用 GPU 自动垃圾回收',
'arg_gc_interval_help': 'GPU 自动垃圾回收检查间隔(秒,默认:30)',
'arg_gc_threshold_help': 'GPU 显存使用率阈值,超过时自动清理(百分比,默认:85.0)',
'arg_smart_reclaim_help': '启用智能内存回收(默认:启用)',
'arg_no_smart_reclaim_help': '禁用智能内存回收',
'arg_lang_help': '界面语言 (zh=中文, en=English)',
# 配置文件相关错误消息
'config_format_unsupported': '不支持的配置文件格式: {}',
'config_not_found': '配置文件不存在: {}',
'config_path_unexpected': '配置文件不在预期目录内: {}',
'config_load_failed': '加载配置文件失败: {}',
# validate_input_size 消息 (使用 print)
'print_size_mismatch': '[WARNING] 输入尺寸宽度和高度不相等 ({}x{}),模型使用正方形输入',
'print_adjusted': '[INFO] 已调整为 {}x{}',
'print_exceeds_max': '[WARNING] 输入尺寸 {}x{} 超过最大支持尺寸 {}x{}',
'print_patch_error': '[WARNING] SPN 编码器在更大尺寸下会出现补丁分割错误',
'print_not_divisible': '[WARNING] 输入尺寸 {}x{} 不能被 64 整除',
'print_still_exceeds': '[WARNING] 调整后的尺寸 {}x{} 仍然超过最大支持尺寸',
# progress_info 默认消息
'progress_processing': '处理中',
# API 响应消息
'api_unsupported_file_type': '不支持的文件类型: {}',
'api_supported_formats': '请上传 JPG、PNG、WebP 或 BMP 格式的图片',
'api_path_traversal': '无效的路径',
'api_save_failed': '保存上传文件失败: {}',
'api_check_format': '请检查文件格式是否正确或联系技术支持',
'api_load_image_failed': '加载图像失败: {}',
'api_check_image_format': '请检查上传的图片格式是否支持(JPG/PNG等)',
'api_image_too_large': '图片尺寸过大 ({}x{}),可能导致性能问题',
'api_redis_failed': 'Redis缓存获取失败: {}, 将使用本地缓存',
'api_ply_save_failed': '缓存结果PLY保存失败: {}',
'api_check_disk': '请检查磁盘空间或联系技术支持',
'api_rename_failed': '重命名文件失败: {}',
'api_vram_insufficient': '显存不足,请使用较小的图片',
'api_vram_solution': '建议使用小于 1024x1024 的图片,或关闭其他占用显存的程序',
'api_inference_failed': '推理过程失败: {}',
'api_retry_or_small': '请尝试重新启动程序或使用较小的图片',
'api_redis_cache_failed': 'Redis 缓存失败: {}',
'api_ply_save_failed2': 'PLY保存失败: {}',
'api_processing_failed': '处理失败: {}',
'api_internal_error': '服务器内部错误,请稍后重试',
'api_resource_not_found': '请求的资源不存在',
'api_validation_failed': '请求参数验证失败',
# 启动横幅
'banner_title': '3D 模型生成工具 - 自动检测 GPU',
'banner_modes': '支持模式:',
'banner_nvidia': 'NVIDIA GPU (CUDA)',
'banner_amd': 'AMD GPU (ROCm)',
'banner_intel': 'Intel GPU (CPU 回退)',
'banner_cpu': 'CPU 模式',
# 性能调优配置名称
'tune_baseline': '基准配置',
'tune_baseline_desc': '无任何优化',
'tune_amp_only': '仅 AMP',
'tune_amp_only_desc': '仅启用混合精度推理',
'tune_cudnn_only': '仅 cuDNN Benchmark',
'tune_cudnn_only_desc': '仅启用 cuDNN 自动调优',
'tune_tf32_only': '仅 TF32',
'tune_tf32_only_desc': '仅启用 TensorFloat32',
'tune_amp_cudnn': 'AMP + cuDNN',
'tune_amp_cudnn_desc': 'AMP 和 cuDNN 自动调优',
'tune_amp_tf32': 'AMP + TF32',
'tune_amp_tf32_desc': 'AMP 和 TensorFloat32',
'tune_all': '全部优化',
'tune_all_desc': '启用所有优化',
'tune_non_nvidia': '非 NVIDIA GPU,仅测试 AMP 优化',
'tune_skip_cudnn': '显卡计算能力 < 6.0,跳过 cuDNN Benchmark',
'tune_skip_tf32': '显卡不支持 TF32,跳过 TF32 测试',
# 其他
'cli_description': 'MLSharp 3D模型生成工具',
'model_import_failed': 'Sharp 模块导入失败: {}',
'model_import_solution': '可能的原因:\n1. Sharp 库未安装\n2. 模型文件路径错误\n3. Python 环境配置不正确\n\n解决方案:\n- 检查 model_assets/ 文件夹是否存在\n- 重新安装依赖: pip install -r requirements.txt\n- 确保使用正确的 Python 环境',
'model_weights_failed': '模型加载失败: {}',
'model_weights_solution': '请检查:\n1. 模型文件是否完整\n2. PyTorch 版本是否兼容\n3. 是否有足够的内存/显存\n4. Python 环境是否正确配置',
'grad_checkpoint_failed': '应用梯度检查点失败: {}',
'grad_checkpoint_fallback': '梯度检查点未启用,将使用正常推理模式',
'mixed_precision_fallback': '混合精度推理失败,回退到 FP32: {}',
'temp_dir_delete_failed': '删除临时目录失败: {}',
'unsafe_unpickle': '不安全的反序列化: {}.{}',
'redis_data_untrusted': 'Redis 数据未被信任,跳过反序列化: {}',
'redis_deserialize_rejected': 'Redis 缓存数据反序列化被拒绝(安全限制): {}',
'http_client_not_init': 'HTTP 客户端未初始化,无法发送 Webhook',
'webhook_send_exception': 'Webhook 发送异常: {} -> {} (错误: {})',
# GPU 垃圾回收
'gpu_gc_complete': 'GPU 垃圾回收完成 - 设备 {}',
'gpu_gc_failed_msg': 'GPU 垃圾回收失败: {}',
'gpu_vram_high': 'GPU 显存使用率过高: {:.1f}%',
'smart_recovery': ' 执行智能内存回收...',
'smart_recovery_failed': '智能内存回收失败: {}',
'gpu_unavailable_monitor': 'GPU 不可用,跳过自动内存监控',
'monitor_exception': '内存监控异常: {}',
'gpu_monitor_stopped_msg': 'GPU 自动内存监控已停止',
# 缓存管理
'cache_hit_debug': '缓存命中: 命中率 {:.1f}% ({}/{})',
'cache_evict': '缓存已满,淘汰最旧条目: {}',
'cache_added': '缓存已添加: {}',
'cache_cleared_msg': '缓存已清空',
# Redis 缓存
'redis_not_installed_msg': 'redis 模块未安装,Redis 缓存将不可用',
'redis_install_cmd_msg': '安装命令: pip install redis',
'redis_connection_failed_msg': 'Redis 连接失败: {}',
'redis_unavailable_msg': 'Redis 缓存将不可用,使用本地缓存代替',
'redis_data_untrusted_msg': 'Redis 数据未被信任,跳过反序列化: {}',
'unsafe_deserialize': '不安全的反序列化: {}.{}',
'redis_cache_hit': 'Redis 缓存命中: {}',
'redis_cache_miss': 'Redis 缓存未命中: {}',
'redis_deserialize_rejected_msg': 'Redis 缓存数据反序列化被拒绝(安全限制): {}',
'redis_get_failed': 'Redis 缓存获取失败: {}',
'redis_cache_added': 'Redis 缓存已添加: {} (TTL: {}s)',
'redis_set_failed': 'Redis 缓存存储失败: {}',
'redis_clear_failed': 'Redis 缓存清空失败: {}',
# Webhook
'httpx_not_installed': 'httpx 模块未安装,Webhook 功能将不可用',
'httpx_install_cmd': '安装命令: pip install httpx',
'webhook_client_init_msg': 'Webhook 客户端已初始化',
'webhook_disabled_msg': 'Webhook 未启用,无法注册',
'http_client_not_init_msg': 'HTTP 客户端未初始化,无法发送 Webhook',
'webhook_send_failed_msg': 'Webhook 发送失败: {} -> {} (状态码: {})',
'webhook_send_exception_msg': 'Webhook 发送异常: {} -> {} (错误: {})',
'webhook_client_closed_msg': 'Webhook 客户端已关闭',
# 性能调优
'test_config_failed': ' 测试失败: {}',
'best_config_result': '最优配置: {}',
'all_tests_failed': '所有配置测试失败,使用默认配置',
'no_config_path': '未指定配置文件路径,无法保存调优结果',
'load_tuning_cache_failed': '加载性能调优缓存失败: {}',
'non_nvidia_amp_only': '非 NVIDIA GPU,仅测试 AMP 优化',
'skip_cudnn_low_compute': '显卡计算能力 < 6.0,跳过 cuDNN Benchmark',
'skip_tf32_not_supported': '显卡不支持 TF32,跳过 TF32 测试',
# API 响应
'internal_server_error': '服务器内部错误,请稍后重试',
'resource_not_found': '请求的资源不存在',
'validation_error': '请求参数验证失败',
'cache_clear_msg': '缓存已清空',
'get_gpu_mem_failed': '获取GPU内存信息失败: {}',
# 启动横幅和服务
'service_url_info': '服务地址: {}',
'browser_open_msg': '浏览器将自动打开...',
'ctrl_c_stop': '按 Ctrl+C 停止服务',
'cleaning_resources': '正在清理资源...',
'gpu_monitor_stopped_log': 'GPU 监控已停止',
'gpu_auto_monitor_stopped': 'GPU 自动内存监控已停止',
'webhook_close_failed_log': '关闭 Webhook 客户端失败: {}',
'resources_cleaned': '资源清理完成',
'thanks_using': '感谢使用 MLSharp!',
'service_start_failed_log': '服务启动失败: {}',
'browser_open_failed': '无法自动打开浏览器: {}',
# ROCm 加速
'rocm_accel': '使用 ROCm 加速',
# 计算能力
'compute_capability_simple': '计算能力: {}',
# CPU 模式
'cpu_mode_simple': '使用 CPU 模式',
# Webhook 关闭
'webhook_closed_log': 'Webhook 客户端已关闭',
# 更多消息
'redis_stats_failed': 'Redis 缓存统计失败: {}',
'redis_conn_closed': 'Redis 连接已关闭',
'redis_conn_close_failed': '关闭 Redis 连接失败: {}',
'tuning_results_updated': '性能调优结果已更新到配置文件: {}',
'tuning_results_added': '性能调优结果已添加到配置文件: {}',
'tuning_results_save_failed': '保存性能调优结果失败: {}',
'testing_optimizations': '正在测试不同优化配置...',
'warmup_exception': '预热运行时出现异常: {}',
'creating_predictor_msg': '正在创建预测器...',
'loading_weights_msg': '正在加载模型权重...',
'loading_weights_to_predictor_msg': '正在加载权重到预测器...',
'model_loaded_success': '模型加载完成!',
'applying_gradient_checkpointing_msg': '正在应用梯度检查点...',
'sharp_import_error_msg': 'Sharp 模块导入失败: {}',
'sharp_import_reasons': '可能的原因:\n1. Sharp 库未安装\n2. 模型文件路径错误\n3. Python 环境配置不正确\n\n解决方案:\n- 检查 model_assets/ 文件夹是否存在\n- 重新安装依赖: pip install -r requirements.txt\n- 确保使用正确的 Python 环境',
'model_load_error_msg': '模型加载失败: {}',
'model_load_check': '请检查:\n1. 模型文件是否完整\n2. PyTorch 版本是否兼容\n3. 是否有足够的内存/显存\n4. Python 环境是否正确配置',
'grad_checkpoint_monodepth': ' 已应用梯度检查点到 monodepth 模型',
'grad_checkpoint_decoder': ' 已应用梯度检查点到 decoder',
'grad_checkpoint_failed_msg': '应用梯度检查点失败: {}',
'grad_checkpoint_fallback_msg': ' 梯度检查点未启用,将使用正常推理模式',
'mixed_precision_fallback_msg': '混合精度推理失败,回退到 FP32: {}',
'temp_dir_delete_failed_msg': '删除临时目录失败: {}',
'clearing_cache': '正在清空缓存...',
'cache_cleared_success': '缓存已清空',
# API 模型描述
'api_status_desc': '请求状态 (success/error)',
'api_url_desc': '生成的 PLY 文件下载地址',
'api_time_desc': '处理时间(秒)',
'api_task_id_desc': '任务 ID',
'api_health_status_desc': '服务状态 (healthy/unhealthy)',
'api_gpu_available_desc': 'GPU 是否可用',
'api_gpu_vendor_desc': 'GPU 厂商 (NVIDIA/AMD/Intel)',
'api_gpu_name_desc': 'GPU 型号名称',
'api_gpu_count_desc': 'GPU 数量',
'api_gpu_memory_desc': '当前 GPU 内存使用量(MB)',
'api_gpu_info_desc': 'GPU 信息',
'api_cache_enabled_desc': '缓存是否启用',
'api_cache_size_desc': '当前缓存条目数',
'api_cache_max_desc': '最大缓存条目数',
'api_cache_hits_desc': '缓存命中次数',
'api_cache_misses_desc': '缓存未命中次数',
'api_cache_rate_desc': '缓存命中率(百分比)',
'api_op_status_desc': '操作状态',
'api_op_message_desc': '操作消息',
'api_error_type_desc': '错误类型',
'api_error_message_desc': '错误消息',
'api_status_code_desc': 'HTTP 状态码',
'api_path_desc': '请求路径',
'api_timestamp_desc': '错误发生时间(ISO 8601 格式)',
'api_description': '基于 Apple SHaRP 模型的 3D 高斯泼溅生成工具',
'api_upload_desc': '上传的图片文件 (JPG格式)',
# 更多API错误消息
'api_unsupported_file_type': '不支持的文件类型: {}, 扩展名: {}',
'api_unsupported_file_simple': '不支持的文件类型: {}',
'api_unknown_format': '无法识别的文件格式,魔数: {}',
'api_header_check_failed': '文件头检查失败: {}',
'api_path_traversal_detected': '路径遍历攻击检测: {}',
'api_invalid_path': '无效的路径',
'api_contact_support': '请联系技术支持',
'api_save_upload_failed': '[Task {}] 保存上传文件失败: {}',
'api_save_upload_msg': '保存上传文件失败: {}',
'api_check_format_support': '请检查文件格式是否正确或联系技术支持',
'api_load_image_failed_task': '[Task {}] 加载图像失败: {}',
'api_load_image_msg': '加载图像失败: {}',
'api_check_image_format': '请检查上传的图片格式是否支持(JPG/PNG等)',
'api_image_too_large_task': '[Task {}] 图片尺寸过大 ({}x{}),可能导致性能问题',
'api_redis_failed_task': '[Task {}] Redis缓存获取失败: {}, 将使用本地缓存',
'api_cache_ply_failed_task': '[Task {}] 缓存结果PLY保存失败: {}',
'api_cache_ply_msg': '缓存结果PLY保存失败: {}',
'api_check_disk_space': '请检查磁盘空间或联系技术支持',
# 批处理 API 消息
'api_batch_limit_exceeded': '批处理数量超过限制: {} > {}',
'api_batch_limit_solution': '请将批处理数量减少到 {} 个以内',
'api_batch_empty': '批处理请求中没有文件',
'api_batch_empty_solution': '请上传至少一个文件',
'api_batch_start': '开始批处理 {} 个文件',
'api_batch_item_start': '[{}/{}] 开始处理: {}',
'api_batch_item_failed': '[{}/{}] 处理失败 {}: {}',
'api_batch_complete': '批处理完成: 成功 {}, 失败 {}, 耗时 {:.2f}s',
'api_unknown_error': '未知错误',
# 批处理响应模型描述
'api_batch_status_desc': '总体状态 (success/partial/error)',
'api_batch_total_desc': '总任务数',
'api_batch_success_desc': '成功数',
'api_batch_failed_desc': '失败数',
'api_batch_time_desc': '总处理时间(秒)',
'api_batch_results_desc': '各任务结果',
'api_batch_item_status_desc': '单项状态 (success/error)',
'api_batch_item_filename_desc': '原始文件名',
'api_batch_item_url_desc': 'PLY文件下载地址(成功时)',
'api_batch_item_error_desc': '错误消息(失败时)',
# vram insufficient task
'api_vram_insufficient_task': '[Task {}] 显存不足: {}',
'api_inference_failed_task': '[Task {}] 推理失败: {}',
'api_ply_save_failed_task': '[Task {}] PLY保存失败: {}',
'api_rename_failed_task': '[Task {}] 重命名失败: {}',
'api_redis_cache_failed_task': '[Task {}] Redis缓存失败: {}',
'api_redis_failed_task': '[Task {}] Redis缓存获取失败: {}',
'api_processing_failed_task': '[Task {}] 处理失败: {}',
'api_webhook_failed_task': '[Task {}] Webhook通知失败: {}',
'api_processing_failed': '处理失败: {}',
'api_retry_small_image': '请尝试使用较小的图片或联系技术支持',
# CLI epilog
'cli_epilog': """
启动模式说明:
auto 自动检测并选择最佳模式(默认)
gpu 强制使用 GPU 模式(自动检测厂商)
cpu 强制使用 CPU 模式
nvidia 强制使用 NVIDIA GPU 模式
amd 强制使用 AMD GPU 模式(ROCm)
配置文件:
支持 YAML 和 JSON 格式
配置文件优先级低于命令行参数
示例:
python app.py # 自动检测模式
python app.py --mode gpu # 强制 GPU 模式
python app.py --config config.yaml # 使用配置文件
python app.py --port 8080 # 使用 8080 端口
""",
},
'en': {
# Error messages
'model_file_not_exists': 'Model file does not exist!',
'model_file_solution': 'Please ensure model file is located at: {}\nDownload URL: Please check project README or contact developer',
'model_size_warning': 'Model file size abnormal (too small), may be corrupted or incomplete\nSuggestion: Re-download model file',
'sharp_import_error': 'Sharp module import failed: {}',
'sharp_import_solution': '''Possible reasons:
1. Sharp library not installed
2. Model file path error
3. Python environment configuration incorrect
Solutions:
- Check if model_assets/ folder exists
- Reinstall dependencies: pip install -r requirements.txt
- Ensure correct Python environment is used''',
'model_load_error': 'Model loading failed: {}',
'model_load_solution': '''Please check:
1. Model file integrity
2. PyTorch version compatibility
3. Sufficient memory/VRAM available
4. Python environment properly configured''',
'gradient_checkpointing_success': 'Gradient checkpointing enabled (VRAM usage will reduce, but inference speed may slightly decrease)',
'gpu_memory_insufficient': 'Insufficient VRAM, please use smaller images',
'gpu_memory_solution': 'Suggested to use images smaller than 1024x1024, or close other VRAM-consuming programs',
'processing_failed': 'Processing failed: {}',
'processing_solution': 'Please try restarting the program or use smaller images',
# Log messages
'model_loading': 'Model Loading',
'model_file': 'Model file: {}',
'model_file_size': 'Model file size: {:.2f} MB',
'creating_predictor': 'Creating predictor...',
'loading_model_weights': 'Loading model weights...',
'loading_weights_to_predictor': 'Loading weights to predictor...',
'model_load_success': 'Model loaded successfully!',
'device_info': 'Device: {}',
'applying_gradient_checkpointing': 'Applying gradient checkpointing...',
'gpu_memory_usage': 'VRAM usage: {:.2f} MB',
'gpu_acceleration_enabled': 'GPU acceleration enabled',
'gpu_vendor': 'GPU vendor: {}',
'gpu_model': 'GPU model: {}',
'compute_capability': 'Compute capability: {}',
'amp_enabled': '[Optimization] Mixed Precision Inference: Enabled',
'amp_disabled': '[Optimization] Mixed Precision Inference: Disabled',
'cudnn_enabled': '[Optimization] cuDNN Benchmark: Enabled',
'cudnn_disabled': '[Optimization] cuDNN Benchmark: Disabled',
'tf32_enabled': '[Optimization] TensorFloat32: Enabled',
'tf32_disabled': '[Optimization] TensorFloat32: Disabled',
'cpu_mode': 'Using CPU mode',
'cpu_cores': 'CPU cores: {}',
'multithreading_enabled': '[Optimization] Multithreading optimization: Enabled',
'cache_enabled': '[Cache] Inference cache: Enabled (max {} entries)',
'cache_disabled': '[Cache] Inference cache: Disabled',
'service_address': 'Service address: {}',
'auto_browser': 'Browser will auto-open...',
'press_ctrl_c': 'Press Ctrl+C to stop service',
'auto_open_failed': 'Unable to auto-open browser: {}',
'manual_access': 'Please access manually: {}',
'cleanup_resources': 'Cleaning up resources...',
'gpu_monitoring_stopped': 'GPU monitoring stopped',
'gpu_auto_gc_stopped': 'GPU auto memory monitoring stopped',
'webhook_client_closed': 'Webhook client closed',
'webhook_close_failed': 'Failed to close Webhook client: {}',
'cleanup_complete': 'Resource cleanup complete',
'service_stopped': 'Service stopped',
'thank_you': 'Thank you for using MLSharp!',
'service_start_failed': 'Service startup failed: {}',
'input_size_mismatch': 'Input width and height not equal ({}x{}), model uses square input',
'input_size_adjusted': 'Adjusted to {}x{}',
'input_size_exceeds_max': 'Input size {}x{} exceeds maximum supported size {}x{}',
'patch_splitting_error': 'SPN encoder will have patch splitting errors with larger sizes',
'input_size_not_divisible': 'Input size {}x{} not divisible by 64',
'adjusted_to': 'Adjusted to {}x{}',
'input_size_still_exceeds': 'Adjusted size {}x{} still exceeds maximum supported size',
'gpu_init': 'GPU Initialization',
'user_specified_mode': 'User specified startup mode: {}',
'auto_detect_mode': 'Auto-detect mode',
'force_cpu_mode': 'Force CPU mode',
'amd_gpu_detected': 'Detected AMD GPU: {}',
'nvidia_gpu_detected': 'Detected NVIDIA GPU: {}',
'intel_gpu_detected': 'Detected Intel GPU: {}',
'unknown_gpu_detected': 'Detected Unknown GPU: {}',
'cuda_version': 'CUDA/ROCm version: {}',
'gpu_count': 'GPU count: {}',
'force_nvidia_mode': 'Force NVIDIA mode, but detected {} GPU',
'set_nvidia_mode': 'Forced NVIDIA mode set',
'force_amd_mode': 'Force AMD mode, but detected {} GPU',
'set_amd_mode': 'Forced AMD mode set',
'compute_capability_info': 'Compute capability: {}',
'gpu_memory_info': 'VRAM: {:.2f} GB',
'low_vram_warning': 'Warning: VRAM less than 4GB, may cause performance issues',
'wmi_detection_failed': 'WMI detection failed: {}',
'rocm_detection_failed': 'ROCm detection failed: {}',
'cuda_unavailable_cpu_mode': 'Using CPU mode\n Reason: CUDA/ROCm unavailable',
'amd_no_rocm': 'Detected AMD GPU, but PyTorch not compiled with ROCm support\n Solution: Install ROCm version of PyTorch',
'nvidia_no_cuda': 'Detected NVIDIA GPU, but CUDA unavailable\n Please check:\n 1. NVIDIA GPU driver installed\n 2. GPU supports CUDA\n 3. PyTorch compiled with CUDA support',
'intel_gpu': 'Detected Intel GPU\n Intel GPU does not support GPU acceleration currently',
'no_supported_gpu': 'No supported GPU detected',
'gpu_memory_query_failed': 'Failed to query GPU memory: {}',
'gpu_cache_cleared': 'GPU cache cleared - Device {}',
'gpu_cache_freed': ' Freed VRAM: {:.2f} MB',
'gpu_cache_clear_failed': 'Failed to clear GPU cache: {}',
'gpu_garbage_collected': 'GPU garbage collection complete - Device {}',
'gpu_memory_recovered': ' Recovered VRAM: {:.2f} MB',
'gpu_gc_failed': 'GPU garbage collection failed: {}',
'gpu_memory_high_usage': 'GPU VRAM usage too high: {:.1f}%',
'gpu_memory_total': ' Total VRAM: {:.2f} MB',
'gpu_memory_used': ' Used: {:.2f} MB',
'gpu_memory_free': ' Free: {:.2f} MB',
'gpu_perform_recovery': ' Performing smart memory recovery...',
'smart_memory_recovery_failed': 'Smart memory recovery failed: {}',
'gpu_monitoring_not_running': 'GPU unavailable, skipping auto memory monitoring',
'gpu_monitor_running': 'Auto memory monitoring already running',
'gpu_monitor_started': 'GPU auto memory monitoring started (interval: {}s, threshold: {}%)',
'gpu_monitor_exception': 'Memory monitoring exception: {}',
'gpu_monitor_stopped': 'GPU auto memory monitoring stopped',
'cache_cleared': 'Cache cleared',
'cache_status': 'Cache status: {}',
'cache_size_info': 'Cache size: {}/{}',
'cache_hits': 'Hits: {}',
'cache_misses': 'Misses: {}',
'cache_hit_rate': 'Hit rate: {:.1f}%',
'redis_connected': 'Redis cache connected: {}',
'redis_not_installed': 'Redis module not installed, Redis cache will be unavailable',
'redis_install_cmd': 'Install command: pip install redis',
'redis_connection_failed': 'Redis connection failed: {}',
'redis_unavailable': 'Redis cache will be unavailable, using local cache instead',
'redis_cache_cleared': 'Redis cache cleared: {} keys',
'redis_cache_empty': 'Redis cache empty',
'webhook_client_init': 'Webhook client initialized',
'webhook_not_installed': 'httpx module not installed, Webhook functionality will be unavailable',
'webhook_install_cmd': 'Install command: pip install httpx',
'webhook_disabled': 'Webhook not enabled, cannot register',
'webhook_registered': 'Webhook registered: {} -> {}',
'webhook_unregistered': 'Webhook unregistered: {}',
'webhook_sent_success': 'Webhook sent successfully: {} -> {}',
'webhook_sent_failed': 'Webhook sending failed: {} -> {} (Status code: {})',
'cache_hit_info': 'Cache hit! PLY save complete, duration: {:.2f}s',
'task_completion_time': 'Processing complete (cache), total duration: {:.2f}s',
'prediction_start': 'Starting inference...',
'prediction_complete': 'Inference complete, duration: {:.2f}s',
'result_cached_to_redis': 'Result cached to Redis',
'ply_saved': 'PLY saved, duration: {:.2f}s',
'task_complete': 'Processing complete, total duration: {:.2f}s',
'rename_failed': 'Failed to rename file: {}',
# System info
'system_info': 'System Information',
'os_info': 'Operating System: {} {}',
'python_version': 'Python Version: {}',
'working_directory': 'Working Directory: {}',
'web_service': 'Web Service',
'input_size_info': 'Input size: {}x{}',
# Performance tuning
'performance_tuning': 'Performance Auto-Tuning',
'testing_configurations': 'Testing different optimization configurations...',
'test_config': 'Test configuration: {}',
'config_description': ' Description: {}',
'avg_inference_time': ' Average inference time: {:.3f} seconds',
'test_failed': ' Test failed: {}',
'tuning_results': 'Tuning Results',
'best_config': 'Best configuration: {}',
'best_config_desc': ' Description: {}',
'avg_inference_time_result': ' Average inference time: {:.3f} seconds',
'throughput_info': ' Throughput: {:.2f} FPS',
'tuning_complete': 'Performance auto-tuning completed!',
'config_applied': 'Optimal configuration applied',
'tuning_failed_default': 'All configuration tests failed, using default configuration',
'tuning_failed': 'Performance auto-tuning failed: {}',
'use_default_config': 'Using default configuration',
'valid_cache_found': 'Found valid performance tuning cache ({} days ago)',
'using_cached_config': 'Using cached performance configuration',
'config_name': 'Configuration name: {}',
'config_description_cached': 'Description: {}',