forked from modelscope/facechain
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
245 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,4 +131,3 @@ result.mp4 | |
|
||
# ast template | ||
ast_index_file.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
{ | ||
"nbformat": 4, | ||
"nbformat_minor": 0, | ||
"metadata": { | ||
"colab": { | ||
"private_outputs": true, | ||
"provenance": [], | ||
"machine_shape": "hm", | ||
"name": "facechain-demo.ipynb" | ||
}, | ||
"kernelspec": { | ||
"name": "python3", | ||
"display_name": "Python 3" | ||
} | ||
}, | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"Requirements:\n", | ||
"- GPU Mem Usage: 19G\n", | ||
"- Disk Usage: About 50G" | ||
], | ||
"metadata": { | ||
"id": "AzOycrSUkK-0" | ||
} | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"## Get facechain source code from GitHub" | ||
], | ||
"metadata": { | ||
"id": "8yQEWTkekIx9" | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"source": [ | ||
"!GIT_LFS_SKIP_SMUDGE=1 git clone https://github.com/modelscope/facechain.git --depth 1" | ||
], | ||
"metadata": { | ||
"id": "WK_uDw0NkHTP" | ||
}, | ||
"execution_count": null, | ||
"outputs": [] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"## Installation requirements\n", | ||
"- Note that you can ignore warning on dependencies conflicts at the end\n", | ||
"- You may use conda virtual env to avoid warning info." | ||
], | ||
"metadata": { | ||
"id": "jUWWSGDG1ZGK" | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"source": [ | ||
"!pip3 install -r facechain/requirements.txt" | ||
], | ||
"metadata": { | ||
"id": "QrwRDBipxKZw" | ||
}, | ||
"execution_count": null, | ||
"outputs": [] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"## Check environment informaiton" | ||
], | ||
"metadata": { | ||
"id": "0miaB1nC2VrA" | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"source": [ | ||
"!nvidia-smi\n", | ||
"!pip3 show torch\n", | ||
"\n", | ||
"# Note that this setup is verified on (cuda 12.0, torch2.0.1+cu118, Nvidia-A100 40G)" | ||
], | ||
"metadata": { | ||
"id": "uvNE0kRxyI4q" | ||
}, | ||
"execution_count": null, | ||
"outputs": [] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [], | ||
"metadata": { | ||
"id": "klba298h2bbu" | ||
} | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"## Installing mmcv-full\n", | ||
"- Several of the underlying models depend on mmcv-full, which could be tricky to install since it is environment-dependent, you may refer to [mmcv's official documentation](https://mmcv.readthedocs.io/zh_CN/latest/get_started/installation.html) for more details..\n", | ||
"- A prebuilt package is provided here for convenience, and was verified on (cuda 12.0, torch2.0.1+cu118, Nvidia-A100 40G)\n", | ||
"- If the prebuilt package does not work on your env setup, please use the alternative installation as suggested by [mmcv's official documentation](https://mmcv.readthedocs.io/zh_CN/latest/get_started/)" | ||
], | ||
"metadata": { | ||
"id": "ciSxxSzI4l_u" | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"source": [ | ||
"# use prebuilt mmcv-full package provided by ModelScope (verified on cuda 12.0, torch2.0.1+cu118, Nvidia-A100 40G)\n", | ||
"!pip3 install https://modelscope.oss-cn-beijing.aliyuncs.com/packages/mmcv/mmcv_full-1.7.0-cp310-cp310-linux_x86_64.whl\n", | ||
"\n", | ||
"\n", | ||
"# alternative manual installtation. note that it may take 30+ mins for building dependencies.\n", | ||
"# !pip3 install -U openmim\n", | ||
"# !mim install mmcv-full==1.7.0\n" | ||
], | ||
"metadata": { | ||
"id": "t2lciBXyyuzA" | ||
}, | ||
"execution_count": null, | ||
"outputs": [] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"source": [ | ||
"## Start facechain WebUI service" | ||
], | ||
"metadata": { | ||
"id": "OxDgRY8H4vta" | ||
} | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"source": [ | ||
"import os\n", | ||
"os.chdir('/path/to/facechain') # Note: replace with your facechain root\n", | ||
"print(os.getcwd())\n", | ||
"\n", | ||
"# Click on the gradio URL to start building your FaceChain digital-twin!\n", | ||
"!python3 app.py" | ||
], | ||
"metadata": { | ||
"id": "NW5o0iiezTCg" | ||
}, | ||
"execution_count": null, | ||
"outputs": [] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"source": [], | ||
"metadata": { | ||
"id": "Ghuyu_0Gx5XN" | ||
}, | ||
"execution_count": null, | ||
"outputs": [] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters