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|
+
},
|
| 9 |
+
"kernelspec": {
|
| 10 |
+
"name": "python3",
|
| 11 |
+
"display_name": "Python 3"
|
| 12 |
+
},
|
| 13 |
+
"language_info": {
|
| 14 |
+
"name": "python"
|
| 15 |
+
},
|
| 16 |
+
"accelerator": "GPU"
|
| 17 |
+
},
|
| 18 |
+
"cells": [
|
| 19 |
+
{
|
| 20 |
+
"cell_type": "code",
|
| 21 |
+
"execution_count": null,
|
| 22 |
+
"metadata": {
|
| 23 |
+
"id": "EIN3zm1gf3Bq"
|
| 24 |
+
},
|
| 25 |
+
"outputs": [],
|
| 26 |
+
"source": [
|
| 27 |
+
"!git lfs install\n",
|
| 28 |
+
"!git clone https://huggingface.co/spaces/vinthony/SadTalker"
|
| 29 |
+
]
|
| 30 |
+
},
|
| 31 |
+
{
|
| 32 |
+
"cell_type": "code",
|
| 33 |
+
"source": [
|
| 34 |
+
"%cd /content/SadTalker\n",
|
| 35 |
+
"!pip install ffmpeg\n",
|
| 36 |
+
"!pip install libsndfile1\n",
|
| 37 |
+
"!pip install -r /content/SadTalker/requirements.txt"
|
| 38 |
+
],
|
| 39 |
+
"metadata": {
|
| 40 |
+
"id": "Aujcev7Zf75-"
|
| 41 |
+
},
|
| 42 |
+
"execution_count": null,
|
| 43 |
+
"outputs": []
|
| 44 |
+
},
|
| 45 |
+
{
|
| 46 |
+
"cell_type": "code",
|
| 47 |
+
"source": [
|
| 48 |
+
"!pip install gradio==3.41.2"
|
| 49 |
+
],
|
| 50 |
+
"metadata": {
|
| 51 |
+
"id": "oRs6Pk2Bhd-t"
|
| 52 |
+
},
|
| 53 |
+
"execution_count": null,
|
| 54 |
+
"outputs": []
|
| 55 |
+
},
|
| 56 |
+
{
|
| 57 |
+
"cell_type": "code",
|
| 58 |
+
"execution_count": null,
|
| 59 |
+
"metadata": {
|
| 60 |
+
"id": "Z8BBgh8Byr2n"
|
| 61 |
+
},
|
| 62 |
+
"outputs": [],
|
| 63 |
+
"source": [
|
| 64 |
+
"#@title for uploading custom pics and videos to the driving videos and image folders\n",
|
| 65 |
+
"from google.colab import files\n",
|
| 66 |
+
"uploaded = files.upload()"
|
| 67 |
+
]
|
| 68 |
+
},
|
| 69 |
+
{
|
| 70 |
+
"cell_type": "code",
|
| 71 |
+
"source": [
|
| 72 |
+
"!python /content/SadTalker/app.py"
|
| 73 |
+
],
|
| 74 |
+
"metadata": {
|
| 75 |
+
"id": "WZ1Qrrx8hqzU"
|
| 76 |
+
},
|
| 77 |
+
"execution_count": null,
|
| 78 |
+
"outputs": []
|
| 79 |
+
},
|
| 80 |
+
{
|
| 81 |
+
"cell_type": "code",
|
| 82 |
+
"source": [
|
| 83 |
+
"!pip install huggingface_hub"
|
| 84 |
+
],
|
| 85 |
+
"metadata": {
|
| 86 |
+
"id": "uxgrIIHIgWa-"
|
| 87 |
+
},
|
| 88 |
+
"execution_count": null,
|
| 89 |
+
"outputs": []
|
| 90 |
+
},
|
| 91 |
+
{
|
| 92 |
+
"cell_type": "code",
|
| 93 |
+
"execution_count": null,
|
| 94 |
+
"metadata": {
|
| 95 |
+
"id": "FaF3RdKdaFa8"
|
| 96 |
+
},
|
| 97 |
+
"outputs": [],
|
| 98 |
+
"source": [
|
| 99 |
+
"#@title Login to HuggingFace 🤗\n",
|
| 100 |
+
"\n",
|
| 101 |
+
"#@markdown You need to accept the model license before downloading or using the Stable Diffusion weights. Please, visit the [model card](https://huggingface.co/runwayml/stable-diffusion-v1-5), read the license and tick the checkbox if you agree. You have to be a registered user in 🤗 Hugging Face Hub, and you'll also need to use an access token for the code to work.\n",
|
| 102 |
+
"# https://huggingface.co/settings/tokens\n",
|
| 103 |
+
"!mkdir -p ~/.huggingface\n",
|
| 104 |
+
"HUGGINGFACE_TOKEN = \"\" #@param {type:\"string\"}\n",
|
| 105 |
+
"!echo -n \"{HUGGINGFACE_TOKEN}\" > ~/.huggingface/token"
|
| 106 |
+
]
|
| 107 |
+
},
|
| 108 |
+
{
|
| 109 |
+
"cell_type": "code",
|
| 110 |
+
"source": [
|
| 111 |
+
"from huggingface_hub import HfApi\n",
|
| 112 |
+
"api = HfApi()\n",
|
| 113 |
+
"api.upload_file(\n",
|
| 114 |
+
" path_or_fileobj=\"\",\n",
|
| 115 |
+
" path_in_repo=\"\",\n",
|
| 116 |
+
" repo_id=\"\",\n",
|
| 117 |
+
" repo_type=\"model\",\n",
|
| 118 |
+
")"
|
| 119 |
+
],
|
| 120 |
+
"metadata": {
|
| 121 |
+
"id": "4xhb_ERGgzll"
|
| 122 |
+
},
|
| 123 |
+
"execution_count": null,
|
| 124 |
+
"outputs": []
|
| 125 |
+
}
|
| 126 |
+
]
|
| 127 |
+
}
|