MCPcopy Index your code
hub / github.com/a312863063/Model-Swap-Face

github.com/a312863063/Model-Swap-Face @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
203 symbols 555 edges 21 files 96 documented · 47%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Better model,Better performance

Model-Swap-Face_v2挂出来了,可以参考使用。

  Note:这个项目展示的是我在数字模特方面的一些探索,希望通过降本增效的方式挖掘生成技术的实际商用价值。此项目展示的是仅支持端到端的单模特头像合成方案,即在保留输入模特表情信息的情况下生成一张更富样式吸引力的新模特。如果想了解支持多模特形象选择的方案可以参阅我的研究笔记

效果预览

单图输入-输出展示

<img src="https://github.com/a312863063/Model-Swap-Face/blob/main/pics/single_input.png" alt="Sample">

输入

<img src="https://github.com/a312863063/Model-Swap-Face/blob/main/pics/single_output.png" alt="Sample">

模特风格输出

多图对比展示

<img src="https://github.com/a312863063/Model-Swap-Face/blob/main/pics/preview.jpg" alt="Sample">

多效果转换图预览

替换效果展示

  此处是展示生成图像替换回原图的效果,引入了额外的后处理。

<img src="https://github.com/a312863063/Model-Swap-Face/blob/main/pics/example_2kids.jpg" alt="Sample">

转小孩子风格图片——左:输入-右:输出

<img src="https://github.com/a312863063/Model-Swap-Face/blob/main/pics/example_2wanghong.png" alt="Sample">

转网红风格图片——左:输入-右:输出

<img src="https://github.com/a312863063/Model-Swap-Face/blob/main/pics/examples_mix.jpg" alt="Sample">

转多种风格图片——1排:输入-2-5排:输出

Inference框架

<img src="https://github.com/a312863063/Model-Swap-Face/blob/main/pics/architecture.png" alt="Sample">

使用方法

环境配置

  • Both Linux and Windows are supported, but we strongly recommend Linux for performance and compatibility reasons.
  • 64-bit Python 3.6 installation. We recommend Anaconda3 with numpy 1.14.3 or newer.
  • TensorFlow 1.10.0 or newer with GPU support.
  • One or more high-end NVIDIA GPUs with at least 11GB of DRAM. We recommend NVIDIA DGX-1 with 8 Tesla V100 GPUs.
  • NVIDIA driver 391.35 or newer, CUDA toolkit 9.0 or newer, cuDNN 7.3.1 or newer.

运行方法

  1.按照netwotk/download_weights.txt所示将模型文件下载至networks文件夹下。

  2.配置好main.py并运行python main.py

多模特选择方案

<img src="https://github.com/a312863063/Model-Swap-Face/blob/main/pics/multi-model-solution.png" alt="Sample">

  多模特选择方案支持更多样的模特选择,实现方法可以参阅我的研究笔记

致谢

  代码部分借用了PuzerPbaylies的代码,感谢分享。

Core symbols most depended-on inside this repo

Shape

Method 105
Function 78
Class 20

Languages

Python100%

Modules by API surface

encoder/model.py33 symbols
dnnlib/tflib/network.py32 symbols
dnnlib/util.py27 symbols
dnnlib/tflib/tfutil.py19 symbols
encoder/perceptual_model.py15 symbols
dnnlib/submission/submit.py14 symbols
encoder/generator_model.py13 symbols
encoder/resnet.py10 symbols
dnnlib/submission/run_context.py10 symbols
dnnlib/tflib/optimizer.py8 symbols
tools/functions.py4 symbols
dnnlib/tflib/autosummary.py4 symbols

For agents

$ claude mcp add Model-Swap-Face \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page