Skip to content

Commit

Permalink
modify image version and mmcv_full install manual (modelscope#468)
Browse files Browse the repository at this point in the history
* modify image version and mmcv_full install manual

* add recommended version mmcv-full

* modify mmcv install manual

---------

Co-authored-by: mulin.lyh <[email protected]>
  • Loading branch information
liuyhwangyh and mulin.lyh authored Mar 26, 2024
1 parent 8141a12 commit f29ed95
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,12 @@ If you are familiar with using docker, we recommend to use this way:

# Step2: Download the docker image (for installing docker engine, refer to https://docs.docker.com/engine/install/)
# For China Mainland users:
docker pull registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-cuda11.8.0-py38-torch2.0.1-tf2.13.0-1.9.4
docker pull registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu22.04-cuda11.8.0-py310-torch2.1.0-tf2.14.0-1.10.0
# For users outside China Mainland:
docker pull registry.us-west-1.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-cuda11.8.0-py38-torch2.0.1-tf2.13.0-1.9.4
docker pull registry.us-west-1.aliyuncs.com/modelscope-repo/modelscope:ubuntu22.04-cuda11.8.0-py310-torch2.1.0-tf2.14.0-1.10.0

# Step3: run the docker container
docker run -it --name facechain -p 7860:7860 --gpus all registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-cuda11.8.0-py38-torch2.0.1-tf2.13.0-1.9.4 /bin/bash
docker run -it --name facechain -p 7860:7860 --gpus all registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu22.04-cuda11.8.0-py310-torch2.1.0-tf2.14.0-1.10.0 /bin/bash
# Note: you may need to install the nvidia-container-runtime, follow the instructions:
# 1. Install nvidia-container-runtime:https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html
# 2. sudo systemctl restart docker
Expand Down Expand Up @@ -169,15 +169,17 @@ Use the conda virtual environment, and refer to [Anaconda](https://docs.anaconda
(Note: mmcv has strict environment requirements and might not be compatible in some cases. It's recommended to use Docker.)

```shell
conda create -n facechain python=3.8 # Verified environments: 3.8 and 3.10
conda create -n facechain python=3.10 # Verified environments: 3.10 and 3.8 recommend 3.10
conda activate facechain

GIT_LFS_SKIP_SMUDGE=1 git clone https://github.com/modelscope/facechain.git --depth 1
cd facechain

pip3 install -r requirements.txt
pip3 install -U openmim
mim install mmcv-full==1.7.0
# install mmcv-full with, ref: https://mmcv.readthedocs.io/en/latest/get_started/installation.html
min install mmcv-full==1.7.2
# Other version please reference mmcv official site.

# Navigate to the facechain directory and run:
python3 app.py
Expand All @@ -191,7 +193,8 @@ python3 app.py

*Note* For windows user, you should pay attention to following steps:
```shell
install mmcv-full by pip: pip3 install mmcv-full
# ref:https://mmcv.readthedocs.io/en/latest/get_started/installation.html
install mmcv-full by min: min install mmcv-full==1.7.2
```

**If you want to use the `Audio Driven Talking Head` tab, please refer to the installation guide in [installation_for_talkinghead](doc/installation_for_talkinghead.md).**
Expand Down
14 changes: 6 additions & 8 deletions README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,12 @@ print(os.getcwd())

# Step2: 将镜像下载到本地 (前提是已经安装了docker engine并启动服务,具体可参考: https://docs.docker.com/engine/install/)
# For China Mainland users:
docker pull registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-cuda11.8.0-py38-torch2.0.1-tf2.13.0-1.9.4
docker pull registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu22.04-cuda11.8.0-py310-torch2.1.0-tf2.14.0-1.10.0
# For users outside China Mainland:
docker pull registry.us-west-1.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-cuda11.8.0-py38-torch2.0.1-tf2.13.0-1.9.4
docker pull registry.us-west-1.aliyuncs.com/modelscope-repo/modelscope:ubuntu22.04-cuda11.8.0-py310-torch2.1.0-tf2.14.0-1.10.0

# Step3: 拉起镜像运行
docker run -it --name facechain -p 7860:7860 --gpus all registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu20.04-cuda11.8.0-py38-torch2.0.1-tf2.13.0-1.9.4 /bin/bash # 注意 your_xxx_image_id 替换成你的镜像id
docker run -it --name facechain -p 7860:7860 --gpus all registry.cn-hangzhou.aliyuncs.com/modelscope-repo/modelscope:ubuntu22.04-cuda11.8.0-py310-torch2.1.0-tf2.14.0-1.10.0 /bin/bash # 注意 your_xxx_image_id 替换成你的镜像id
# 注意: 如果提示无法使用宿主机GPU的错误,可能需要安装nvidia-container-runtime
# 1. 安装nvidia-container-runtime:https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html
# 2. 重启docker服务:sudo systemctl restart docker
Expand Down Expand Up @@ -178,7 +178,9 @@ cd facechain

pip3 install -r requirements.txt
pip3 install -U openmim
mim install mmcv-full==1.7.0

# 参考mmcv官方文档 https://mmcv.readthedocs.io/en/latest/get_started/installation.html
mim install mmcv-full==1.7.2

# 进入facechain文件夹,执行:
python3 app.py
Expand All @@ -188,10 +190,6 @@ python3 app.py
# 最后点击log中生成的URL即可访问页面。
```

备注:如果是Windows环境还需要注意以下步骤:
```shell
# pip方式安装mmcv-full: pip3 install mmcv-full
```

**如果您想要使用"人物说话视频生成"标签页的功能,请参考[installation_for_talkinghead_ZH](doc/installation_for_talkinghead_ZH.md)里的安装使用教程。**

Expand Down
14 changes: 11 additions & 3 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,19 @@
print("--installing controlnet_aux...")
launch.run_pip("install controlnet_aux==0.0.6", "requirements for controlnet_aux")

if not launch.is_installed("mmcv"):
print("--installing mmcv...")
def get_pytorch_version():
import torch
version = torch.__version__

def get_python_version():
import sys
return sys.version_info[0] + "." + sys.version_info[1]

if not launch.is_installed("mmcv-full"):
print("--installing mmcv...")
# Todo 这里有坑
try:
launch.run_pip("install mmcv-full==1.7.0", "requirements for mmcv")
launch.run_min("install mmcv-full==1.7.2")
except Exception as e:
print(e)
if os.name == 'nt': # Windows
Expand Down

0 comments on commit f29ed95

Please sign in to comment.