部署修复: - torch.load 增加 weights_only=False patch,兼容 PyTorch 2.6+ 加载旧权重 - OSS 改为懒加载,本地用 output_format=base64 无需配凭证即可启动 - 补全被 gitignore 误排除的必需代码:core/models/layers/data、models/layers/data、keypoints/lib - webui 训练命令 --xformers 改 --sdpa(修复 xformers 无 CUDA 支持报错) 功能调整: - hair_grow_service 端口改 8899、preview 路由修复(send_file) - list_hairstyles 增加发型白名单,测试页只展示当前5个发型 新增脚本: - train_lora_parallel.py:直接调 kohya 并行训练 LoRA(绕过 photo_service 串行限制) - train_hairstyles_parallel.py / train_batch_stepC.py:批量训练辅助脚本 - scripts/sync_data_to_server.sh:大文件断点续传到云服务器 文档: - docs/换发型集成文档.md:换发型完整流程、服务架构、资源依赖、训练方法、集成步骤
43 lines
928 B
Python
43 lines
928 B
Python
# config.py
|
|
|
|
cfg_mnet = {
|
|
'name': 'mobilenet0.25',
|
|
'min_sizes': [[16, 32], [64, 128], [256, 512]],
|
|
'steps': [8, 16, 32],
|
|
'variance': [0.1, 0.2],
|
|
'clip': False,
|
|
'loc_weight': 2.0,
|
|
'gpu_train': True,
|
|
'batch_size': 32,
|
|
'ngpu': 1,
|
|
'epoch': 250,
|
|
'decay1': 190,
|
|
'decay2': 220,
|
|
'image_size': 640,
|
|
'pretrain': True,
|
|
'return_layers': {'stage1': 1, 'stage2': 2, 'stage3': 3},
|
|
'in_channel': 32,
|
|
'out_channel': 64
|
|
}
|
|
|
|
cfg_re50 = {
|
|
'name': 'Resnet50',
|
|
'min_sizes': [[16, 32], [64, 128], [256, 512]],
|
|
'steps': [8, 16, 32],
|
|
'variance': [0.1, 0.2],
|
|
'clip': False,
|
|
'loc_weight': 2.0,
|
|
'gpu_train': True,
|
|
'batch_size': 24,
|
|
'ngpu': 4,
|
|
'epoch': 100,
|
|
'decay1': 70,
|
|
'decay2': 90,
|
|
'image_size': 840,
|
|
'pretrain': True,
|
|
'return_layers': {'layer2': 1, 'layer3': 2, 'layer4': 3},
|
|
'in_channel': 256,
|
|
'out_channel': 256
|
|
}
|
|
|