An updated version of virtual model making

Overview

Model-Swap-Face v2


  这个项目是基于stylegan2 pSp制作的,比v1版本Model-Swap-Face在推理速度和图像质量上有一定提升。主要的功能是将虚拟模特进行环球不同区域的风格转换,目前转换器提供西欧模特东亚模特北非模特三种主流的风格样式,可帮我们实现生产资料零成本化以及广告制作的高效化;此外项目还提供了去位姿编码器以获得模特的正脸肖像。投射器的版权所有:www.seeprettyface.com。此块内容目前还没有花很多精力搞,先当做一种资源分享给大家。



效果预览

Sample





Inference框架

Sample





使用方法

环境配置

  参照pSp文档进行环境配置。

下载模型

  模型下载地址参见pretrained_models文件夹中的txt文档,主要包括的模型如下:
  encoder.pt -- 含位姿编码器
  encoder_without_pos.pt -- 去位姿编码器
  projector_EastAsian.pt -- 东亚模特投射器
  projector_WestEuropean.pt -- 西欧模特投射器
  projector_NorthAfrican.pt -- 北非模特投射器
  shape_predictor_68_face_landmarks.dat -- 人脸检测
  79999_iter.pth -- 人脸mask分割



运行代码

  将图片放在input文件夹下,然后编辑scripts/inference.py,运行如下代码:
  python scripts/inference.py
  结果会保存在output文件夹下



了解更多

  我周末的时候喜欢思考一些新的应用场景和模式,欢迎访问我的网站了解更多。

You might also like...
RepVGG: Making VGG-style ConvNets Great Again
RepVGG: Making VGG-style ConvNets Great Again

RepVGG: Making VGG-style ConvNets Great Again (PyTorch) This is a super simple ConvNet architecture that achieves over 80% top-1 accuracy on ImageNet

A toolkit for making real world machine learning and data analysis applications in C++

dlib C++ library Dlib is a modern C++ toolkit containing machine learning algorithms and tools for creating complex software in C++ to solve real worl

《Train in Germany, Test in The USA: Making 3D Object Detectors Generalize》(CVPR 2020)
《Train in Germany, Test in The USA: Making 3D Object Detectors Generalize》(CVPR 2020)

Train in Germany, Test in The USA: Making 3D Object Detectors Generalize This paper has been accpeted by Conference on Computer Vision and Pattern Rec

[ICLR 2021 Spotlight Oral] "Undistillable: Making A Nasty Teacher That CANNOT teach students", Haoyu Ma, Tianlong Chen, Ting-Kuei Hu, Chenyu You, Xiaohui Xie, Zhangyang Wang

Undistillable: Making A Nasty Teacher That CANNOT teach students "Undistillable: Making A Nasty Teacher That CANNOT teach students" Haoyu Ma, Tianlong

A tool for making map images from OpenTTD save games
A tool for making map images from OpenTTD save games

OpenTTD Surveyor A tool for making map images from OpenTTD save games. This is not part of the main OpenTTD codebase, nor is it ever intended to be pa

[ICLR2021] Unlearnable Examples: Making Personal Data Unexploitable

Unlearnable Examples Code for ICLR2021 Spotlight Paper "Unlearnable Examples: Making Personal Data Unexploitable " by Hanxun Huang, Xingjun Ma, Sarah

RepVGG: Making VGG-style ConvNets Great Again

This repository is the code that needs to be submitted for OpenMMLab Algorithm Ecological Challenge,the paper is RepVGG: Making VGG-style ConvNets Great Again

Decentralized Reinforcment Learning: Global Decision-Making via Local Economic Transactions (ICML 2020)
Decentralized Reinforcment Learning: Global Decision-Making via Local Economic Transactions (ICML 2020)

Decentralized Reinforcement Learning This is the code complementing the paper Decentralized Reinforcment Learning: Global Decision-Making via Local Ec

TensorFlow Similarity is a python package focused on making similarity learning quick and easy.
TensorFlow Similarity is a python package focused on making similarity learning quick and easy.

TensorFlow Similarity is a python package focused on making similarity learning quick and easy.

Comments
  • Can we train the model on TPU?

    Can we train the model on TPU?

    I want to train the model for African Ethnicity on Colab TPU. But when I do it, "from op import FusedLeakyReLU, fused_leaky_relu, upfirdn2d" is wrong (No CUDA Home ./local/..) in "model.py".

    I guess it may be an issue in folder "op" since it defines c++ extension.

    would you mind taking some advice for me ?

    opened by JANVI2411 0
  • How to save projector model while training?

    How to save projector model while training?

    I'm training a model for African projector model

    I started the training, assuming --checkpoint_path_E is encoder.pt --checkpoint_path_D is stylegan2-ffhq-config-f.pt --checkpoint_path_P is 79999_iter.pth

    I set --save_interval to 1000, so every 1000 steps the model will get saved.

    Now, In the --exp_dir we will have the saved model in checkpoints folder and I think that model we can use as projector_African.pt

    I tried inference by setting --checkpoint_path_E is encoder.pt --checkpoint_path_D= projector_African.pt --checkpoint_path_P is 79999_iter.pth

    I got below error: KeyError 'g_ema' not found

    I checked the projector_African.pt keys and I got these : dict_keys(['state_dict', 'opts'])

    while I checked your provided projector_EastAsian.pt keys I got these: dict_keys(['g_ema', 'latent_avg'])

    Why both models have different keys? Am I missing something while training?

    opened by JANVI2411 0
  • Parameters are missing in training options.

    Parameters are missing in training options.

    Hello, Thanks for this amazing repo.

    I'm able to do inference using available pretrained models but not able to start training due to below issue:

    I think 3 checkpoints are required which are mentioned in the below file: https://github.com/a312863063/Model-Swap-Face_v2/blob/main/models/psp.py#L25

    I couldn't find them in the below argument files: https://github.com/a312863063/Model-Swap-Face_v2/blob/main/options/train_options.py

    What are these 3 checkpoints while training? encoder_dict = torch.load(args.checkpoint_path_E, map_location='cpu') # {'state_dict', 'opts'} decoder_dict = torch.load(args.checkpoint_path_D, map_location='cpu') # {'g_ema', 'latent_avg'} parser_dict = torch.load(args.checkpoint_path_P, map_location='cpu')

    opened by JANVI2411 0
Owner
seeprettyface.com
seeprettyface.com
AI Virtual Calculator: This is a simple virtual calculator based on Artificial intelligence.

AI Virtual Calculator: This is a simple virtual calculator that works with gestures using OpenCV. We will use our hand in the air to click on the calc

Md. Rakibul Islam 1 Jan 13, 2022
A PaddlePaddle version of Neural Renderer, refer to its PyTorch version

Neural 3D Mesh Renderer in PadddlePaddle A PaddlePaddle version of Neural Renderer, refer to its PyTorch version Install Run: pip install neural-rende

AgentMaker 13 Jul 12, 2022
Advanced Deep Learning with TensorFlow 2 and Keras (Updated for 2nd Edition)

Advanced Deep Learning with TensorFlow 2 and Keras (Updated for 2nd Edition)

Packt 1.5k Jan 3, 2023
Updated for TTS(CE) = Also Known as TTN V3. The code requires the first server to be 'ttn' protocol.

Updated Updated for TTS(CE) = Also Known as TTN V3. The code requires the first server to be 'ttn' protocol. Introduction This balenaCloud (previously

Remko 1 Oct 17, 2021
naked is a Python tool which allows you to strip a model and only keep what matters for making predictions.

naked is a Python tool which allows you to strip a model and only keep what matters for making predictions. The result is a pure Python function with no third-party dependencies that you can simply copy/paste wherever you wish.

Max Halford 24 Dec 20, 2022
In this project we investigate the performance of the SetCon model on realistic video footage. Therefore, we implemented the model in PyTorch and tested the model on two example videos.

Contrastive Learning of Object Representations Supervisor: Prof. Dr. Gemma Roig Institutions: Goethe University CVAI - Computational Vision & Artifici

Dirk Neuhäuser 6 Dec 8, 2022
Step by Step on how to create an vision recognition model using LOBE.ai, export the model and run the model in an Azure Function

Step by Step on how to create an vision recognition model using LOBE.ai, export the model and run the model in an Azure Function

El Bruno 3 Mar 30, 2022
A PaddlePaddle version image model zoo.

Paddle-Image-Models English | 简体中文 A PaddlePaddle version image model zoo. Install Package Install by pip: $ pip install ppim Install by wheel package

AgentMaker 131 Dec 7, 2022
A modified version of DeepMind's Alphafold2 to divide CPU part (MSA and template searching) and GPU part (prediction model)

ParallelFold Author: Bozitao Zhong This is a modified version of DeepMind's Alphafold2 to divide CPU part (MSA and template searching) and GPU part (p

Bozitao Zhong 77 Dec 22, 2022