包含: - hair_service_sd: 主服务(换发型/换发色/生发,端口8801) - photo_service: LoRA调度+训练(端口32678) - hair_grow_service: 调试测试页(端口8888,含4个测试页) - 批量训练脚本(batch_train_hairstyles.py) - 发际线mask自动识别(hairline_mask.py,4种方案) - 手绘mask换发型(hair_swap_manual.py) - 文档:README.md + LARGE_FILES.md + docs/ 大文件(模型权重200G、训练数据123G)已排除,见 LARGE_FILES.md OSS/COS密钥已脱敏为环境变量,原文件备份在本地
33 lines
1.1 KiB
Python
33 lines
1.1 KiB
Python
import os
|
|
|
|
if __name__ == '__main__':
|
|
in_dir = "/mnt/database2/jiangqian/0808/online_orig_train_datas_2"
|
|
out_dir = "/mnt/database2/jiangqian/0808/online_train_datas_2"
|
|
|
|
dirs = os.listdir(in_dir)
|
|
|
|
for single_dir in dirs:
|
|
if "traindata" in single_dir:
|
|
in_single_dir = os.path.join(in_dir, single_dir)
|
|
out_single_dir = os.path.join(out_dir, single_dir)
|
|
|
|
if not os.path.exists(out_single_dir):
|
|
os.makedirs(out_single_dir)
|
|
|
|
images_dir = os.path.join(out_single_dir, "images")
|
|
if not os.path.exists(images_dir):
|
|
os.makedirs(images_dir)
|
|
|
|
hairstyle_dir = os.path.join(images_dir, "1_hairstyle")
|
|
if not os.path.exists(hairstyle_dir):
|
|
os.makedirs(hairstyle_dir)
|
|
|
|
for root, dirs, files in os.walk(in_single_dir):
|
|
for file in files:
|
|
in_file = os.path.join(root, file)
|
|
out_file = os.path.join(hairstyle_dir, file)
|
|
os.system("cp %s %s" % (in_file, out_file))
|
|
print("copy %s to %s" % (in_file, out_file))
|
|
|
|
|