Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1 +1,19 @@
|
|
1 |
-
{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.12","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"nvidiaTeslaT4","dataSources":[{"sourceId":6898670,"sourceType":"datasetVersion","datasetId":3954404},{"sourceId":6925544,"sourceType":"datasetVersion","datasetId":3953428}],"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":true}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"# Colab for roop-unleashed - Gradio version\nhttps://github.com/C0untFloyd/roop-unleashed\n","metadata":{"id":"G9BdiCppV6AS"}},{"cell_type":"markdown","source":"Installing & preparing requirements","metadata":{"id":"0ZYRNb0AWLLW"}},{"cell_type":"code","source":"!git clone https://github.com/C0untFloyd/roop-unleashed.git\n%cd roop-unleashed\n!mv /kaggle/input/config/config_colab.yaml config.yaml\n!pip install pip install -r requirements.txt","metadata":{"id":"t1yPuhdySqCq","execution":{"iopub.status.busy":"2023-12-14T08:38:42.261656Z","iopub.execute_input":"2023-12-14T08:38:42.261978Z","iopub.status.idle":"2023-12-14T08:43:22.254873Z","shell.execute_reply.started":"2023-12-14T08:38:42.261951Z","shell.execute_reply":"2023-12-14T08:43:22.253615Z"},"trusted":true},"execution_count":1,"outputs":[{"name":"stdout","text":"Cloning into 'roop-unleashed'...\nremote: Enumerating objects: 2540, done.\u001b[K\nremote: Counting objects: 100% (5/5), done.\u001b[K\nremote: Compressing objects: 100% (5/5), done.\u001b[K\nremote: Total 2540 (delta 0), reused 2 (delta 0), pack-reused 2535\u001b[K\nReceiving objects: 100% (2540/2540), 103.84 MiB | 15.59 MiB/s, done.\nResolving deltas: 100% (1579/1579), done.\n/kaggle/working/roop-unleashed\nmv: cannot remove '/kaggle/input/config/config_colab.yaml': Read-only file system\nLooking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu118\nIgnoring torch: markers 'sys_platform == \"darwin\"' don't match your environment\nIgnoring torchvision: markers 'sys_platform == \"darwin\"' don't match your environment\nIgnoring onnxruntime: markers 'sys_platform == \"darwin\" and platform_machine != \"arm64\"' don't match your environment\nIgnoring onnxruntime-silicon: markers 'sys_platform == \"darwin\" and platform_machine == \"arm64\"' don't match your environment\nRequirement already satisfied: pip in /opt/conda/lib/python3.10/site-packages (23.2.1)\nCollecting install\n Downloading install-1.3.5-py3-none-any.whl (3.2 kB)\nCollecting numpy==1.24.2 (from -r requirements.txt (line 3))\n Downloading numpy-1.24.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m17.3/17.3 MB\u001b[0m \u001b[31m40.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n\u001b[?25hCollecting gradio==3.44.2 (from -r requirements.txt (line 4))\n Obtaining dependency information for gradio==3.44.2 from https://files.pythonhosted.org/packages/37/dd/833d4f5b7e9908bcc4a637353663820779825185c727c5dd35d398bf1e40/gradio-3.44.2-py3-none-any.whl.metadata\n Downloading gradio-3.44.2-py3-none-any.whl.metadata (17 kB)\nCollecting opencv-python==4.8.0.76 (from -r requirements.txt (line 5))\n Obtaining dependency information for opencv-python==4.8.0.76 from https://files.pythonhosted.org/packages/f5/d0/2e455d894ec0d6527e662ad55e70c04f421ad83a6fd0a54c3dd73c411282/opencv_python-4.8.0.76-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata\n Downloading opencv_python-4.8.0.76-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (19 kB)\nCollecting onnx==1.14.1 (from -r requirements.txt (line 6))\n Obtaining dependency information for onnx==1.14.1 from https://files.pythonhosted.org/packages/47/d4/f2d212558245e252b936247666c3f5981e6dba62ec470ff8be3df3389364/onnx-1.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata\n Downloading onnx-1.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (15 kB)\nCollecting insightface==0.7.3 (from -r requirements.txt (line 7))\n Downloading insightface-0.7.3.tar.gz (439 kB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m439.5/439.5 kB\u001b[0m \u001b[31m34.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n\u001b[?25h Installing build dependencies ... \u001b[?25ldone\n\u001b[?25h Getting requirements to build wheel ... \u001b[?25ldone\n\u001b[?25h Installing backend dependencies ... \u001b[?25ldone\n\u001b[?25h Preparing metadata (pyproject.toml) ... \u001b[?25ldone\n\u001b[?25hCollecting psutil==5.9.5 (from -r requirements.txt (line 8))\n Downloading psutil-5.9.5-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (282 kB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m282.1/282.1 kB\u001b[0m \u001b[31m18.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n\u001b[?25hCollecting pillow==10.0.1 (from -r requirements.txt (line 9))\n Obtaining dependency information for pillow==10.0.1 from https://files.pythonhosted.org/packages/7a/07/e896b096a77375e78e02ce222ae4fd6014928cd76c691d312060a1645dfa/Pillow-10.0.1-cp310-cp310-manylinux_2_28_x86_64.whl.metadata\n Downloading Pillow-10.0.1-cp310-cp310-manylinux_2_28_x86_64.whl.metadata (9.5 kB)\nCollecting torch==2.0.1+cu118 (from -r requirements.txt (line 10))\n Downloading https://download.pytorch.org/whl/cu118/torch-2.0.1%2Bcu118-cp310-cp310-linux_x86_64.whl (2267.3 MB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m2.3/2.3 GB\u001b[0m \u001b[31m?\u001b[0m eta \u001b[36m0:00:00\u001b[0ma \u001b[36m0:00:01\u001b[0m00:01\u001b[0m\n\u001b[?25hCollecting torchvision==0.15.2+cu118 (from -r requirements.txt (line 12))\n Downloading https://download.pytorch.org/whl/cu118/torchvision-0.15.2%2Bcu118-cp310-cp310-linux_x86_64.whl (6.1 MB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m6.1/6.1 MB\u001b[0m \u001b[31m72.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m00:01\u001b[0m\n\u001b[?25hCollecting onnxruntime-gpu==1.16.1 (from -r requirements.txt (line 16))\n Obtaining dependency information for onnxruntime-gpu==1.16.1 from https://files.pythonhosted.org/packages/22/aa/f7c78b440e94478f72d2a627ec82be4032b9b8141a2506f2ec7d99645483/onnxruntime_gpu-1.16.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata\n Downloading onnxruntime_gpu-1.16.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.1 kB)\nCollecting protobuf==4.23.2 (from -r requirements.txt (line 17))\n Obtaining dependency information for protobuf==4.23.2 from https://files.pythonhosted.org/packages/14/23/f3b852093f3a7031049313913e04431e7a32bd9752adfaf79d1193cf05b1/protobuf-4.23.2-cp37-abi3-manylinux2014_x86_64.whl.metadata\n Downloading protobuf-4.23.2-cp37-abi3-manylinux2014_x86_64.whl.metadata (540 bytes)\nRequirement already satisfied: tqdm==4.66.1 in /opt/conda/lib/python3.10/site-packages (from -r requirements.txt (line 18)) (4.66.1)\nCollecting ftfy (from -r requirements.txt (line 19))\n Obtaining dependency information for ftfy from https://files.pythonhosted.org/packages/91/f8/dfa32d06cfcbdb76bc46e0f5d69c537de33f4cedb1a15cd4746ab45a6a26/ftfy-6.1.3-py3-none-any.whl.metadata\n Downloading ftfy-6.1.3-py3-none-any.whl.metadata (6.2 kB)\nRequirement already satisfied: regex in /opt/conda/lib/python3.10/site-packages (from -r requirements.txt (line 20)) (2023.8.8)\nCollecting pyvirtualcam (from -r requirements.txt (line 21))\n Obtaining dependency information for pyvirtualcam from https://files.pythonhosted.org/packages/a5/f0/82eda564710e51de6f39fe5d669ad0d661f29c6175df6f33aa8bcc1a3618/pyvirtualcam-0.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata\n Downloading pyvirtualcam-0.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (5.1 kB)\nCollecting aiofiles<24.0,>=22.0 (from gradio==3.44.2->-r requirements.txt (line 4))\n Obtaining dependency information for aiofiles<24.0,>=22.0 from https://files.pythonhosted.org/packages/c5/19/5af6804c4cc0fed83f47bff6e413a98a36618e7d40185cd36e69737f3b0e/aiofiles-23.2.1-py3-none-any.whl.metadata\n Downloading aiofiles-23.2.1-py3-none-any.whl.metadata (9.7 kB)\nRequirement already satisfied: altair<6.0,>=4.2.0 in /opt/conda/lib/python3.10/site-packages (from gradio==3.44.2->-r requirements.txt (line 4)) (5.2.0)\nRequirement already satisfied: fastapi in /opt/conda/lib/python3.10/site-packages (from gradio==3.44.2->-r requirements.txt (line 4)) (0.101.1)\nCollecting ffmpy (from gradio==3.44.2->-r requirements.txt (line 4))\n Downloading ffmpy-0.3.1.tar.gz (5.5 kB)\n Preparing metadata (setup.py) ... \u001b[?25ldone\n\u001b[?25hCollecting gradio-client==0.5.0 (from gradio==3.44.2->-r requirements.txt (line 4))\n Obtaining dependency information for gradio-client==0.5.0 from https://files.pythonhosted.org/packages/fe/85/ec0323f39192c4bee04e8e06e64213aff816b9d1b61c3c8367e75b1c7e10/gradio_client-0.5.0-py3-none-any.whl.metadata\n Downloading gradio_client-0.5.0-py3-none-any.whl.metadata (7.1 kB)\nCollecting httpx (from gradio==3.44.2->-r requirements.txt (line 4))\n Obtaining dependency information for httpx from https://files.pythonhosted.org/packages/a2/65/6940eeb21dcb2953778a6895281c179efd9100463ff08cb6232bb6480da7/httpx-0.25.2-py3-none-any.whl.metadata\n Downloading httpx-0.25.2-py3-none-any.whl.metadata (6.9 kB)\nRequirement already satisfied: huggingface-hub>=0.14.0 in /opt/conda/lib/python3.10/site-packages (from gradio==3.44.2->-r requirements.txt (line 4)) (0.19.4)\nRequirement already satisfied: importlib-resources<7.0,>=1.3 in /opt/conda/lib/python3.10/site-packages (from gradio==3.44.2->-r requirements.txt (line 4)) (5.13.0)\nRequirement already satisfied: jinja2<4.0 in /opt/conda/lib/python3.10/site-packages (from gradio==3.44.2->-r requirements.txt (line 4)) (3.1.2)\nRequirement already satisfied: markupsafe~=2.0 in /opt/conda/lib/python3.10/site-packages (from gradio==3.44.2->-r requirements.txt (line 4)) (2.1.3)\nRequirement already satisfied: matplotlib~=3.0 in /opt/conda/lib/python3.10/site-packages (from gradio==3.44.2->-r requirements.txt (line 4)) (3.7.4)\nRequirement already satisfied: orjson~=3.0 in /opt/conda/lib/python3.10/site-packages (from gradio==3.44.2->-r requirements.txt (line 4)) (3.9.5)\nRequirement already satisfied: packaging in /opt/conda/lib/python3.10/site-packages (from gradio==3.44.2->-r requirements.txt (line 4)) (21.3)\nRequirement already satisfied: pandas<3.0,>=1.0 in /opt/conda/lib/python3.10/site-packages (from gradio==3.44.2->-r requirements.txt (line 4)) (2.0.3)\nRequirement already satisfied: pydantic!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,<3.0.0,>=1.7.4 in /opt/conda/lib/python3.10/site-packages (from gradio==3.44.2->-r requirements.txt (line 4)) (1.10.12)\nRequirement already satisfied: pydub in /opt/conda/lib/python3.10/site-packages (from gradio==3.44.2->-r requirements.txt (line 4)) (0.25.1)\nCollecting python-multipart (from gradio==3.44.2->-r requirements.txt (line 4))\n Downloading python_multipart-0.0.6-py3-none-any.whl (45 kB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m45.7/45.7 kB\u001b[0m \u001b[31m3.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n\u001b[?25hRequirement already satisfied: pyyaml<7.0,>=5.0 in /opt/conda/lib/python3.10/site-packages (from gradio==3.44.2->-r requirements.txt (line 4)) (6.0.1)\nRequirement already satisfied: requests~=2.0 in /opt/conda/lib/python3.10/site-packages (from gradio==3.44.2->-r requirements.txt (line 4)) (2.31.0)\nCollecting semantic-version~=2.0 (from gradio==3.44.2->-r requirements.txt (line 4))\n Downloading semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)\nRequirement already satisfied: typing-extensions~=4.0 in /opt/conda/lib/python3.10/site-packages (from gradio==3.44.2->-r requirements.txt (line 4)) (4.5.0)\nRequirement already satisfied: uvicorn>=0.14.0 in /opt/conda/lib/python3.10/site-packages (from gradio==3.44.2->-r requirements.txt (line 4)) (0.23.2)\nCollecting websockets<12.0,>=10.0 (from gradio==3.44.2->-r requirements.txt (line 4))\n Downloading websockets-11.0.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (129 kB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m129.9/129.9 kB\u001b[0m \u001b[31m11.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n\u001b[?25hRequirement already satisfied: scipy in /opt/conda/lib/python3.10/site-packages (from insightface==0.7.3->-r requirements.txt (line 7)) (1.11.4)\nRequirement already satisfied: scikit-learn in /opt/conda/lib/python3.10/site-packages (from insightface==0.7.3->-r requirements.txt (line 7)) (1.2.2)\nRequirement already satisfied: scikit-image in /opt/conda/lib/python3.10/site-packages (from insightface==0.7.3->-r requirements.txt (line 7)) (0.21.0)\nRequirement already satisfied: easydict in /opt/conda/lib/python3.10/site-packages (from insightface==0.7.3->-r requirements.txt (line 7)) (1.11)\nRequirement already satisfied: cython in /opt/conda/lib/python3.10/site-packages (from insightface==0.7.3->-r requirements.txt (line 7)) (3.0.0)\nRequirement already satisfied: albumentations in /opt/conda/lib/python3.10/site-packages (from insightface==0.7.3->-r requirements.txt (line 7)) (1.3.1)\nRequirement already satisfied: prettytable in /opt/conda/lib/python3.10/site-packages (from insightface==0.7.3->-r requirements.txt (line 7)) (3.8.0)\nRequirement already satisfied: filelock in /opt/conda/lib/python3.10/site-packages (from torch==2.0.1+cu118->-r requirements.txt (line 10)) (3.12.2)\nRequirement already satisfied: sympy in /opt/conda/lib/python3.10/site-packages (from torch==2.0.1+cu118->-r requirements.txt (line 10)) (1.12)\nRequirement already satisfied: networkx in /opt/conda/lib/python3.10/site-packages (from torch==2.0.1+cu118->-r requirements.txt (line 10)) (3.1)\nCollecting triton==2.0.0 (from torch==2.0.1+cu118->-r requirements.txt (line 10))\n Downloading https://download.pytorch.org/whl/triton-2.0.0-1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (63.3 MB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m63.3/63.3 MB\u001b[0m \u001b[31m19.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n\u001b[?25hCollecting coloredlogs (from onnxruntime-gpu==1.16.1->-r requirements.txt (line 16))\n Downloading coloredlogs-15.0.1-py2.py3-none-any.whl (46 kB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m46.0/46.0 kB\u001b[0m \u001b[31m3.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n\u001b[?25hRequirement already satisfied: flatbuffers in /opt/conda/lib/python3.10/site-packages (from onnxruntime-gpu==1.16.1->-r requirements.txt (line 16)) (23.5.26)\nRequirement already satisfied: fsspec in /opt/conda/lib/python3.10/site-packages (from gradio-client==0.5.0->gradio==3.44.2->-r requirements.txt (line 4)) (2023.12.2)\nCollecting cmake (from triton==2.0.0->torch==2.0.1+cu118->-r requirements.txt (line 10))\n Obtaining dependency information for cmake from https://files.pythonhosted.org/packages/0f/92/69c0ff59697c8f8199283b35d6f3be575e52526d65894330f25e9933f31b/cmake-3.28.0-py2.py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata\n Downloading cmake-3.28.0-py2.py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (6.3 kB)\nCollecting lit (from triton==2.0.0->torch==2.0.1+cu118->-r requirements.txt (line 10))\n Downloading lit-17.0.6.tar.gz (153 kB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m153.0/153.0 kB\u001b[0m \u001b[31m12.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n\u001b[?25h Installing build dependencies ... \u001b[?25ldone\n\u001b[?25h Getting requirements to build wheel ... \u001b[?25ldone\n\u001b[?25h Installing backend dependencies ... \u001b[?25ldone\n\u001b[?25h Preparing metadata (pyproject.toml) ... \u001b[?25ldone\n\u001b[?25hCollecting wcwidth<0.3.0,>=0.2.12 (from ftfy->-r requirements.txt (line 19))\n Obtaining dependency information for wcwidth<0.3.0,>=0.2.12 from https://files.pythonhosted.org/packages/31/b1/a59de0ad3aabb17523a39804f4c6df3ae87ead053a4e25362ae03d73d03a/wcwidth-0.2.12-py2.py3-none-any.whl.metadata\n Downloading wcwidth-0.2.12-py2.py3-none-any.whl.metadata (14 kB)\nRequirement already satisfied: jsonschema>=3.0 in /opt/conda/lib/python3.10/site-packages (from altair<6.0,>=4.2.0->gradio==3.44.2->-r requirements.txt (line 4)) (4.19.0)\nRequirement already satisfied: toolz in /opt/conda/lib/python3.10/site-packages (from altair<6.0,>=4.2.0->gradio==3.44.2->-r requirements.txt (line 4)) (0.12.0)\nRequirement already satisfied: contourpy>=1.0.1 in /opt/conda/lib/python3.10/site-packages (from matplotlib~=3.0->gradio==3.44.2->-r requirements.txt (line 4)) (1.1.0)\nRequirement already satisfied: cycler>=0.10 in /opt/conda/lib/python3.10/site-packages (from matplotlib~=3.0->gradio==3.44.2->-r requirements.txt (line 4)) (0.11.0)\nRequirement already satisfied: fonttools>=4.22.0 in /opt/conda/lib/python3.10/site-packages (from matplotlib~=3.0->gradio==3.44.2->-r requirements.txt (line 4)) (4.42.1)\nRequirement already satisfied: kiwisolver>=1.0.1 in /opt/conda/lib/python3.10/site-packages (from matplotlib~=3.0->gradio==3.44.2->-r requirements.txt (line 4)) (1.4.4)\nRequirement already satisfied: pyparsing>=2.3.1 in /opt/conda/lib/python3.10/site-packages (from matplotlib~=3.0->gradio==3.44.2->-r requirements.txt (line 4)) (3.0.9)\nRequirement already satisfied: python-dateutil>=2.7 in /opt/conda/lib/python3.10/site-packages (from matplotlib~=3.0->gradio==3.44.2->-r requirements.txt (line 4)) (2.8.2)\nRequirement already satisfied: pytz>=2020.1 in /opt/conda/lib/python3.10/site-packages (from pandas<3.0,>=1.0->gradio==3.44.2->-r requirements.txt (line 4)) (2023.3)\nRequirement already satisfied: tzdata>=2022.1 in /opt/conda/lib/python3.10/site-packages (from pandas<3.0,>=1.0->gradio==3.44.2->-r requirements.txt (line 4)) (2023.3)\nRequirement already satisfied: charset-normalizer<4,>=2 in /opt/conda/lib/python3.10/site-packages (from requests~=2.0->gradio==3.44.2->-r requirements.txt (line 4)) (3.2.0)\nRequirement already satisfied: idna<4,>=2.5 in /opt/conda/lib/python3.10/site-packages (from requests~=2.0->gradio==3.44.2->-r requirements.txt (line 4)) (3.4)\nRequirement already satisfied: urllib3<3,>=1.21.1 in /opt/conda/lib/python3.10/site-packages (from requests~=2.0->gradio==3.44.2->-r requirements.txt (line 4)) (1.26.15)\nRequirement already satisfied: certifi>=2017.4.17 in /opt/conda/lib/python3.10/site-packages (from requests~=2.0->gradio==3.44.2->-r requirements.txt (line 4)) (2023.11.17)\nRequirement already satisfied: click>=7.0 in /opt/conda/lib/python3.10/site-packages (from uvicorn>=0.14.0->gradio==3.44.2->-r requirements.txt (line 4)) (8.1.7)\nRequirement already satisfied: h11>=0.8 in /opt/conda/lib/python3.10/site-packages (from uvicorn>=0.14.0->gradio==3.44.2->-r requirements.txt (line 4)) (0.14.0)\nRequirement already satisfied: qudida>=0.0.4 in /opt/conda/lib/python3.10/site-packages (from albumentations->insightface==0.7.3->-r requirements.txt (line 7)) (0.0.4)\nRequirement already satisfied: opencv-python-headless>=4.1.1 in /opt/conda/lib/python3.10/site-packages (from albumentations->insightface==0.7.3->-r requirements.txt (line 7)) (4.8.1.78)\nRequirement already satisfied: imageio>=2.27 in /opt/conda/lib/python3.10/site-packages (from scikit-image->insightface==0.7.3->-r requirements.txt (line 7)) (2.31.1)\nRequirement already satisfied: tifffile>=2022.8.12 in /opt/conda/lib/python3.10/site-packages (from scikit-image->insightface==0.7.3->-r requirements.txt (line 7)) (2023.8.12)\nRequirement already satisfied: PyWavelets>=1.1.1 in /opt/conda/lib/python3.10/site-packages (from scikit-image->insightface==0.7.3->-r requirements.txt (line 7)) (1.4.1)\nRequirement already satisfied: lazy_loader>=0.2 in /opt/conda/lib/python3.10/site-packages (from scikit-image->insightface==0.7.3->-r requirements.txt (line 7)) (0.3)\nCollecting humanfriendly>=9.1 (from coloredlogs->onnxruntime-gpu==1.16.1->-r requirements.txt (line 16))\n Downloading humanfriendly-10.0-py2.py3-none-any.whl (86 kB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m86.8/86.8 kB\u001b[0m \u001b[31m7.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n\u001b[?25hRequirement already satisfied: starlette<0.28.0,>=0.27.0 in /opt/conda/lib/python3.10/site-packages (from fastapi->gradio==3.44.2->-r requirements.txt (line 4)) (0.27.0)\nRequirement already satisfied: anyio in /opt/conda/lib/python3.10/site-packages (from httpx->gradio==3.44.2->-r requirements.txt (line 4)) (3.7.1)\nCollecting httpcore==1.* (from httpx->gradio==3.44.2->-r requirements.txt (line 4))\n Obtaining dependency information for httpcore==1.* from https://files.pythonhosted.org/packages/56/ba/78b0a99c4da0ff8b0f59defa2f13ca4668189b134bd9840b6202a93d9a0f/httpcore-1.0.2-py3-none-any.whl.metadata\n Downloading httpcore-1.0.2-py3-none-any.whl.metadata (20 kB)\nRequirement already satisfied: sniffio in /opt/conda/lib/python3.10/site-packages (from httpx->gradio==3.44.2->-r requirements.txt (line 4)) (1.3.0)\nRequirement already satisfied: joblib>=1.1.1 in /opt/conda/lib/python3.10/site-packages (from scikit-learn->insightface==0.7.3->-r requirements.txt (line 7)) (1.3.2)\nRequirement already satisfied: threadpoolctl>=2.0.0 in /opt/conda/lib/python3.10/site-packages (from scikit-learn->insightface==0.7.3->-r requirements.txt (line 7)) (3.2.0)\nRequirement already satisfied: mpmath>=0.19 in /opt/conda/lib/python3.10/site-packages (from sympy->torch==2.0.1+cu118->-r requirements.txt (line 10)) (1.3.0)\nRequirement already satisfied: attrs>=22.2.0 in /opt/conda/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio==3.44.2->-r requirements.txt (line 4)) (23.1.0)\nRequirement already satisfied: jsonschema-specifications>=2023.03.6 in /opt/conda/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio==3.44.2->-r requirements.txt (line 4)) (2023.7.1)\nRequirement already satisfied: referencing>=0.28.4 in /opt/conda/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio==3.44.2->-r requirements.txt (line 4)) (0.30.2)\nRequirement already satisfied: rpds-py>=0.7.1 in /opt/conda/lib/python3.10/site-packages (from jsonschema>=3.0->altair<6.0,>=4.2.0->gradio==3.44.2->-r requirements.txt (line 4)) (0.9.2)\nRequirement already satisfied: six>=1.5 in /opt/conda/lib/python3.10/site-packages (from python-dateutil>=2.7->matplotlib~=3.0->gradio==3.44.2->-r requirements.txt (line 4)) (1.16.0)\nRequirement already satisfied: exceptiongroup in /opt/conda/lib/python3.10/site-packages (from anyio->httpx->gradio==3.44.2->-r requirements.txt (line 4)) (1.1.3)\nDownloading gradio-3.44.2-py3-none-any.whl (20.2 MB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m20.2/20.2 MB\u001b[0m \u001b[31m38.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0mm\n\u001b[?25hDownloading opencv_python-4.8.0.76-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (61.7 MB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m61.7/61.7 MB\u001b[0m \u001b[31m17.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n\u001b[?25hDownloading onnx-1.14.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.6 MB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m14.6/14.6 MB\u001b[0m \u001b[31m47.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n\u001b[?25hDownloading Pillow-10.0.1-cp310-cp310-manylinux_2_28_x86_64.whl (3.6 MB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m3.6/3.6 MB\u001b[0m \u001b[31m53.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0mta \u001b[36m0:00:01\u001b[0m\n\u001b[?25hDownloading onnxruntime_gpu-1.16.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (153.4 MB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m153.4/153.4 MB\u001b[0m \u001b[31m6.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m:00:01\u001b[0m00:01\u001b[0m\n\u001b[?25hDownloading protobuf-4.23.2-cp37-abi3-manylinux2014_x86_64.whl (304 kB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m304.5/304.5 kB\u001b[0m \u001b[31m20.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n\u001b[?25hDownloading gradio_client-0.5.0-py3-none-any.whl (298 kB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m298.2/298.2 kB\u001b[0m \u001b[31m20.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n\u001b[?25hDownloading ftfy-6.1.3-py3-none-any.whl (53 kB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m53.4/53.4 kB\u001b[0m \u001b[31m4.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n\u001b[?25hDownloading pyvirtualcam-0.11.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (141 kB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m141.4/141.4 kB\u001b[0m \u001b[31m10.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n\u001b[?25hDownloading aiofiles-23.2.1-py3-none-any.whl (15 kB)\nDownloading wcwidth-0.2.12-py2.py3-none-any.whl (34 kB)\nDownloading httpx-0.25.2-py3-none-any.whl (74 kB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m75.0/75.0 kB\u001b[0m \u001b[31m5.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n\u001b[?25hDownloading httpcore-1.0.2-py3-none-any.whl (76 kB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m76.9/76.9 kB\u001b[0m \u001b[31m6.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n\u001b[?25hDownloading cmake-3.28.0-py2.py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (26.3 MB)\n\u001b[2K \u001b[90mββββββββββββββββββββββββββββββββββββββββ\u001b[0m \u001b[32m26.3/26.3 MB\u001b[0m \u001b[31m28.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m00:01\u001b[0m00:01\u001b[0m\n\u001b[?25hBuilding wheels for collected packages: insightface, ffmpy, lit\n Building wheel for insightface (pyproject.toml) ... \u001b[?25ldone\n\u001b[?25h Created wheel for insightface: filename=insightface-0.7.3-cp310-cp310-linux_x86_64.whl size=872761 sha256=c7c4eed616b54f4af4cd544c0c8c26cb66d12a220d29dd7cfd6ecfd8f12ffe00\n Stored in directory: /root/.cache/pip/wheels/e3/d0/80/e3773fb8b6d1cca87ea1d33d9b1f20a223a6493c896da249b5\n Building wheel for ffmpy (setup.py) ... \u001b[?25ldone\n\u001b[?25h Created wheel for ffmpy: filename=ffmpy-0.3.1-py3-none-any.whl size=5579 sha256=c52e90e2b53b0092757ab6dba466b682ffae53629f805fc10612aceb25cc2ce6\n Stored in directory: /root/.cache/pip/wheels/01/a6/d1/1c0828c304a4283b2c1639a09ad86f83d7c487ef34c6b4a1bf\n Building wheel for lit (pyproject.toml) ... \u001b[?25ldone\n\u001b[?25h Created wheel for lit: filename=lit-17.0.6-py3-none-any.whl size=93255 sha256=362420f323cc9b24a24c3eef40820398f60fa5787745401aacd4cee6f155c0d2\n Stored in directory: /root/.cache/pip/wheels/30/dd/04/47d42976a6a86dc2ab66d7518621ae96f43452c8841d74758a\nSuccessfully built insightface ffmpy lit\nInstalling collected packages: wcwidth, lit, ffmpy, cmake, websockets, semantic-version, python-multipart, psutil, protobuf, pillow, numpy, install, humanfriendly, httpcore, ftfy, aiofiles, pyvirtualcam, opencv-python, onnx, httpx, coloredlogs, onnxruntime-gpu, gradio-client, gradio, insightface, triton, torch, torchvision\n Attempting uninstall: wcwidth\n Found existing installation: wcwidth 0.2.6\n Uninstalling wcwidth-0.2.6:\n Successfully uninstalled wcwidth-0.2.6\n Attempting uninstall: websockets\n Found existing installation: websockets 12.0\n Uninstalling websockets-12.0:\n Successfully uninstalled websockets-12.0\n Attempting uninstall: psutil\n Found existing installation: psutil 5.9.3\n Uninstalling psutil-5.9.3:\n Successfully uninstalled psutil-5.9.3\n Attempting uninstall: protobuf\n Found existing installation: protobuf 3.20.3\n Uninstalling protobuf-3.20.3:\n Successfully uninstalled protobuf-3.20.3\n Attempting uninstall: pillow\n Found existing installation: Pillow 10.1.0\n Uninstalling Pillow-10.1.0:\n Successfully uninstalled Pillow-10.1.0\n Attempting uninstall: numpy\n Found existing installation: numpy 1.24.3\n Uninstalling numpy-1.24.3:\n Successfully uninstalled numpy-1.24.3\n Attempting uninstall: opencv-python\n Found existing installation: opencv-python 4.8.1.78\n Uninstalling opencv-python-4.8.1.78:\n Successfully uninstalled opencv-python-4.8.1.78\n Attempting uninstall: onnx\n Found existing installation: onnx 1.15.0\n Uninstalling onnx-1.15.0:\n Successfully uninstalled onnx-1.15.0\n Attempting uninstall: torch\n Found existing installation: torch 2.0.0\n Uninstalling torch-2.0.0:\n Successfully uninstalled torch-2.0.0\n Attempting uninstall: torchvision\n Found existing installation: torchvision 0.15.1\n Uninstalling torchvision-0.15.1:\n Successfully uninstalled torchvision-0.15.1\n\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\ncudf 23.8.0 requires cupy-cuda11x>=12.0.0, which is not installed.\ncuml 23.8.0 requires cupy-cuda11x>=12.0.0, which is not installed.\ndask-cudf 23.8.0 requires cupy-cuda11x>=12.0.0, which is not installed.\napache-beam 2.46.0 requires dill<0.3.2,>=0.3.1.1, but you have dill 0.3.7 which is incompatible.\napache-beam 2.46.0 requires protobuf<4,>3.12.2, but you have protobuf 4.23.2 which is incompatible.\napache-beam 2.46.0 requires pyarrow<10.0.0,>=3.0.0, but you have pyarrow 11.0.0 which is incompatible.\nbeatrix-jupyterlab 2023.814.150030 requires jupyter-server~=1.16, but you have jupyter-server 2.12.1 which is incompatible.\nbeatrix-jupyterlab 2023.814.150030 requires jupyterlab~=3.4, but you have jupyterlab 4.0.5 which is incompatible.\ncudf 23.8.0 requires pandas<1.6.0dev0,>=1.3, but you have pandas 2.0.3 which is incompatible.\ncuml 23.8.0 requires dask==2023.7.1, but you have dask 2023.12.0 which is incompatible.\ncuml 23.8.0 requires distributed==2023.7.1, but you have distributed 2023.12.0 which is incompatible.\ndask-cuda 23.8.0 requires dask==2023.7.1, but you have dask 2023.12.0 which is incompatible.\ndask-cuda 23.8.0 requires distributed==2023.7.1, but you have distributed 2023.12.0 which is incompatible.\ndask-cuda 23.8.0 requires pandas<1.6.0dev0,>=1.3, but you have pandas 2.0.3 which is incompatible.\ndask-cudf 23.8.0 requires dask==2023.7.1, but you have dask 2023.12.0 which is incompatible.\ndask-cudf 23.8.0 requires distributed==2023.7.1, but you have distributed 2023.12.0 which is incompatible.\ndask-cudf 23.8.0 requires pandas<1.6.0dev0,>=1.3, but you have pandas 2.0.3 which is incompatible.\ngoogle-cloud-aiplatform 0.6.0a1 requires google-api-core[grpc]<2.0.0dev,>=1.22.2, but you have google-api-core 2.11.1 which is incompatible.\ngoogle-cloud-automl 1.0.1 requires google-api-core[grpc]<2.0.0dev,>=1.14.0, but you have google-api-core 2.11.1 which is incompatible.\ngoogle-cloud-bigquery 2.34.4 requires protobuf<4.0.0dev,>=3.12.0, but you have protobuf 4.23.2 which is incompatible.\ngoogle-cloud-bigtable 1.7.3 requires protobuf<4.0.0dev, but you have protobuf 4.23.2 which is incompatible.\ngoogle-cloud-pubsub 2.18.3 requires grpcio<2.0dev,>=1.51.3, but you have grpcio 1.51.1 which is incompatible.\ngoogle-cloud-vision 2.8.0 requires protobuf<4.0.0dev,>=3.19.0, but you have protobuf 4.23.2 which is incompatible.\njupyterlab 4.0.5 requires jupyter-lsp>=2.0.0, but you have jupyter-lsp 1.5.1 which is incompatible.\njupyterlab-lsp 5.0.1 requires jupyter-lsp>=2.0.0, but you have jupyter-lsp 1.5.1 which is incompatible.\njupyterlab-lsp 5.0.1 requires jupyterlab<5.0.0a0,>=4.0.6, but you have jupyterlab 4.0.5 which is incompatible.\nkfp 2.0.1 requires google-cloud-storage<3,>=2.2.1, but you have google-cloud-storage 1.44.0 which is incompatible.\nkfp 2.0.1 requires protobuf<4,>=3.13.0, but you have protobuf 4.23.2 which is incompatible.\nkfp-pipeline-spec 0.2.2 requires protobuf<4,>=3.13.0, but you have protobuf 4.23.2 which is incompatible.\nlibpysal 4.9.2 requires packaging>=22, but you have packaging 21.3 which is incompatible.\nlibpysal 4.9.2 requires shapely>=2.0.1, but you have shapely 1.8.5.post1 which is incompatible.\nmomepy 0.7.0 requires shapely>=2, but you have shapely 1.8.5.post1 which is incompatible.\npymc3 3.11.5 requires numpy<1.22.2,>=1.15.0, but you have numpy 1.24.2 which is incompatible.\npymc3 3.11.5 requires scipy<1.8.0,>=1.7.3, but you have scipy 1.11.4 which is incompatible.\nraft-dask 23.8.0 requires dask==2023.7.1, but you have dask 2023.12.0 which is incompatible.\nraft-dask 23.8.0 requires distributed==2023.7.1, but you have distributed 2023.12.0 which is incompatible.\nspopt 0.6.0 requires shapely>=2.0.1, but you have shapely 1.8.5.post1 which is incompatible.\ntensorflow-metadata 0.14.0 requires protobuf<4,>=3.7, but you have protobuf 4.23.2 which is incompatible.\ntensorflow-transform 0.14.0 requires protobuf<4,>=3.7, but you have protobuf 4.23.2 which is incompatible.\ntensorflowjs 4.14.0 requires packaging~=23.1, but you have packaging 21.3 which is incompatible.\nydata-profiling 4.5.1 requires numpy<1.24,>=1.16.0, but you have numpy 1.24.2 which is incompatible.\u001b[0m\u001b[31m\n\u001b[0mSuccessfully installed aiofiles-23.2.1 cmake-3.28.0 coloredlogs-15.0.1 ffmpy-0.3.1 ftfy-6.1.3 gradio-3.44.2 gradio-client-0.5.0 httpcore-1.0.2 httpx-0.25.2 humanfriendly-10.0 insightface-0.7.3 install-1.3.5 lit-17.0.6 numpy-1.24.2 onnx-1.14.1 onnxruntime-gpu-1.16.1 opencv-python-4.8.0.76 pillow-10.0.1 protobuf-4.21.12 psutil-5.9.5 python-multipart-0.0.6 pyvirtualcam-0.11.0 semantic-version-2.10.0 torch-2.0.1+cu118 torchvision-0.15.2+cu118 triton-2.0.0 wcwidth-0.2.12 websockets-11.0.3\n","output_type":"stream"}]},{"cell_type":"code","source":"# - Option 2: Running with Ngrok - #\n\nNgrok_token = \"2ZWTws788W0yCRfSiYv577ERD43_71cfSv4z3v4mr2otT4WED\" #@param {type:\"string\"}\n# Put your ngrok token here (obtainable from https://ngrok.com)\n\nNgrok_domain = \"\" # optional, leave empty if you don't have a domain\n\n# -------------------------------- #\n\n!pip install pyngrok\n\nfrom pyngrok import ngrok, conf\nimport fileinput\nimport sys\n\nif Ngrok_token!=\"\":\n ngrok.kill()\n srv=ngrok.connect(7860 , pyngrok_config=conf.PyngrokConfig(auth_token=Ngrok_token),\n bind_tls=True, domain=Ngrok_domain).public_url\n print(srv)\n get_ipython().system(\"python run.py\")\nelse:\n print('An ngrok token is required. You can get one on https://ngrok.com and paste it into the ngrok_token field.')","metadata":{"execution":{"iopub.status.busy":"2023-12-14T08:46:16.518991Z","iopub.execute_input":"2023-12-14T08:46:16.519381Z"},"trusted":true},"execution_count":null,"outputs":[{"name":"stdout","text":"Requirement already satisfied: pyngrok in /opt/conda/lib/python3.10/site-packages (7.0.3)\nRequirement already satisfied: PyYAML in /opt/conda/lib/python3.10/site-packages (from pyngrok) (6.0.1)\nhttps://c0a1-34-172-117-153.ngrok-free.app\n/opt/conda/lib/python3.10/site-packages/scipy/__init__.py:146: UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected version 1.24.2\n warnings.warn(f\"A NumPy version >={np_minversion} and <{np_maxversion}\"\nUsing provider ['CUDAExecutionProvider'] - Device:cuda\nRunning on local URL: http://127.0.0.1:7860\n\nTo create a public link, set `share=True` in `launch()`.\n","output_type":"stream"}]},{"cell_type":"markdown","source":"Running roop-unleashed with default config","metadata":{"id":"u_4JQiSlV9Fi"}},{"cell_type":"code","source":"!apt-get update && apt-get install ffmpeg libsm6 libxext6 -y\n","metadata":{"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"### Download generated images folder\n(only needed if you want to zip the generated output)","metadata":{"id":"UdQ1VHdI8lCf"}},{"cell_type":"code","source":"import shutil\nimport os\nfrom google.colab import files\n\ndef zip_directory(directory_path, zip_path):\n shutil.make_archive(zip_path, 'zip', directory_path)\n\n# Set the directory path you want to download\ndirectory_path = '/content/roop-unleashed/output'\n\n# Set the zip file name\nzip_filename = 'fake_output.zip'\n\n# Zip the directory\nzip_directory(directory_path, zip_filename)\n\n# Download the zip file\nfiles.download(zip_filename+'.zip')\n","metadata":{"id":"oYjWveAmw10X","outputId":"5b4c3650-f951-434a-c650-5525a8a70c1e","trusted":true},"execution_count":null,"outputs":[]}]}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
pip install gradio
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
# Define your face swapping function here
|
5 |
+
def swap_faces(image):
|
6 |
+
# Your face swapping logic here
|
7 |
+
return swapped_image
|
8 |
+
|
9 |
+
# Create Gradio interface
|
10 |
+
iface = gr.Interface(fn=swap_faces,
|
11 |
+
inputs="image",
|
12 |
+
outputs="image",
|
13 |
+
title="Face Swapping",
|
14 |
+
description="Upload an image to swap faces.")
|
15 |
+
|
16 |
+
# Launch Gradio interface
|
17 |
+
iface.launch()
|
18 |
+
|
19 |
+
python app.py
|