Tool Sharing#
FaceChain is a deep learning tool used to generate personal digital twins. With just a portrait photo, you can create your own digital twin and start generating personal photos in different scenarios.
Features#
Fun......
Deployment#
Official tutorial:
- Use the notebook environment provided by ModelScope, which offers free GPU resources.
# Step 1: My notebook -> PAI-DSW -> GPU environment
# Step 2: Open the Terminal and clone the GitHub code to your local machine
GIT_LFS_SKIP_SMUDGE=1 git clone https://github.com/modelscope/facechain.git --depth 1
# Step 3: Go to the Notebook cell and execute:
import os
os.chdir('/mnt/workspace/facechain') # Replace with the main path of the cloned code folder mentioned above
print(os.getcwd())
!pip3 install gradio
!python3 app.py
# Step 4: Click on the generated URL to access the web page and upload photos to start training and prediction.
- Docker deployment
# Step 1: Download the image to your local machine (Assuming you have already installed Docker Engine and started the service, for more details, please refer to: https://docs.docker.com/engine/install/)
docker pull registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-cuda11.7.1-py38-torch2.0.1-tf1.15.5-1.8.0
# Step 2: Get the image ID and run it
docker images
docker run -it --name facechain -p 7860:7860 --gpus all your_xxx_image_id /bin/bash # Replace your_xxx_image_id with your image ID
(Note: If you encounter an error indicating that the host GPU cannot be used, you may need to install nvidia-container-runtime, refer to: https://github.com/NVIDIA/nvidia-container-runtime)
# Step 3: Install gradio in the container
pip3 install gradio
# Step 4: Get the facechain source code
GIT_LFS_SKIP_SMUDGE=1 git clone https://github.com/modelscope/facechain.git --depth 1
cd facechain
python3 app.py
# Step 5: Click on the "public URL", in the format of https://xxx.gradio.live
Platform#
Official ModelScope: https://modelscope.cn/my/mynotebook
Docker deployment
Conda deployment
Declaration#
This article is only for sharing tools.
This article is synchronized with HBlog.