Spaces:
Sleeping
Sleeping
File size: 2,392 Bytes
e7b9fb6 |
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 |
"""
配置文件
"""
import os
from typing import Dict, Any
# 文件限制
MAX_FILE_SIZE_MB = 50
SUPPORTED_FORMATS = ['.obj', '.glb', '.ply', '.stl']
# 处理参数
DEFAULT_PROCESSING_PARAMS = {
'input_pc_num': 8192,
'confidence_threshold': 0.8,
'generate_preview': True,
'timeout_seconds': 120,
}
# 演示提示模板
DEMO_PROMPTS = {
'human': "realistic human skeleton for walking and animation",
'animal': "four-legged animal with spine and tail bones for natural movement",
'robot': "mechanical robot with joint articulation for industrial movements",
'bird': "bird skeleton with wing bones for flight animation",
'generic': "articulated skeleton suitable for animation"
}
# 示例模型描述
EXAMPLE_MODELS = [
{
'name': 'Boy Character',
'file': 'boy.obj',
'prompt': DEMO_PROMPTS['human'],
'description': 'Human character suitable for walk cycle and basic animations'
},
{
'name': 'Dog Model',
'file': 'dog.obj',
'prompt': DEMO_PROMPTS['animal'],
'description': 'Quadruped animal with natural bone structure'
},
{
'name': 'Bird Model',
'file': 'bird.obj',
'prompt': DEMO_PROMPTS['bird'],
'description': 'Bird with wing bones for flight animations'
},
{
'name': 'Robot/Mech',
'file': 'ironman.obj',
'prompt': DEMO_PROMPTS['robot'],
'description': 'Mechanical character with joint-based movement'
}
]
# UI配置
UI_CONFIG = {
'title': '🎯 MagicArticulate MVP',
'description': """
AI-powered 3D model articulation using skeletal generation.
Upload a 3D model and get an automatically generated skeleton for animation.
""",
'theme': 'soft',
'show_tips': True,
'max_examples': 4
}
# 性能配置
PERFORMANCE_CONFIG = {
'use_gpu': True,
'mixed_precision': 'fp16',
'batch_size': 1,
'max_concurrent_requests': 2,
'cleanup_temp_files': True
}
def get_config() -> Dict[str, Any]:
"""获取完整配置"""
return {
'file_limits': {
'max_size_mb': MAX_FILE_SIZE_MB,
'supported_formats': SUPPORTED_FORMATS
},
'processing': DEFAULT_PROCESSING_PARAMS,
'prompts': DEMO_PROMPTS,
'examples': EXAMPLE_MODELS,
'ui': UI_CONFIG,
'performance': PERFORMANCE_CONFIG
} |