├── 4d_humans_colab.ipynb ├── 4d_humans_gradio_colab.ipynb ├── 4d_humans_video_colab.ipynb ├── LICENSE └── README.md /4d_humans_colab.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": { 6 | "id": "view-in-github" 7 | }, 8 | "source": [ 9 | "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/camenduru/4D-Humans-colab/blob/main/4d_humans_colab.ipynb)" 10 | ] 11 | }, 12 | { 13 | "cell_type": "code", 14 | "execution_count": null, 15 | "metadata": { 16 | "id": "VjYy0F2gZIPR" 17 | }, 18 | "outputs": [], 19 | "source": [ 20 | "%cd /content\n", 21 | "\n", 22 | "!apt -y install -qq aria2\n", 23 | "\n", 24 | "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/4D-Humans/resolve/main/train/multiruns/hmr2/0/checkpoints/epoch%3D35-step%3D1000000.ckpt -d /content/models -o model.ckpt\n", 25 | "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/4D-Humans/resolve/main/model_final_f05665.pkl -d /content/models -o model_final_f05665.pkl\n", 26 | "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/4D-Humans/raw/main/train/multiruns/hmr2/0/model_config.yaml -d /content/models -o model_config.yaml\n", 27 | "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/4D-Humans/resolve/main/SMPL_to_J19.pkl -d /content/models -o SMPL_to_J19.pkl\n", 28 | "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/4D-Humans/resolve/main/smpl_mean_params.npz -d /content/models -o smpl_mean_params.npz\n", 29 | "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/4D-Humans/resolve/main/smpl/SMPL_FEMALE.pkl -d /content/models/smpl -o SMPL_FEMALE.pkl\n", 30 | "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/4D-Humans/resolve/main/smpl/SMPL_MALE.pkl -d /content/models/smpl -o SMPL_MALE.pkl\n", 31 | "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/4D-Humans/resolve/main/smpl/SMPL_NEUTRAL.pkl -d /content/models/smpl -o SMPL_NEUTRAL.pkl\n", 32 | "\n", 33 | "!git clone -b dev https://github.com/camenduru/4D-Humans\n", 34 | "!rm -rf /content/4D-Humans/vendor/detectron2\n", 35 | "!git clone https://github.com/camenduru/detectron2 /content/4D-Humans/vendor/detectron2\n", 36 | "!git -C /content/4D-Humans/vendor/detectron2 fetch\n", 37 | "!git -C /content/4D-Humans/vendor/detectron2 checkout 0df924ce6066fb97d5413244614b12fbabaf65c8\n", 38 | "\n", 39 | "!pip install pytorch-lightning smplx==0.1.28 pyrender opencv-python yacs scikit-image einops timm\n", 40 | "!pip install -e /content/4D-Humans/vendor/detectron2/" 41 | ] 42 | }, 43 | { 44 | "cell_type": "code", 45 | "execution_count": null, 46 | "metadata": {}, 47 | "outputs": [], 48 | "source": [ 49 | "%cd /content/4D-Humans\n", 50 | "!python demo.py --img_folder /content/4D-Humans/example_data/images --out_folder /content/4D-Humans/demo_out --batch_size=48 --side_view" 51 | ] 52 | }, 53 | { 54 | "cell_type": "code", 55 | "execution_count": null, 56 | "metadata": {}, 57 | "outputs": [], 58 | "source": [ 59 | "from IPython.display import Image, display\n", 60 | "import os\n", 61 | "output_images = [\"/content/4D-Humans/demo_out/\" + i for i in os.listdir(\"/content/4D-Humans/demo_out/\") if \".png\" in i]\n", 62 | "for img in output_images:\n", 63 | " display(Image(img))" 64 | ] 65 | } 66 | ], 67 | "metadata": { 68 | "accelerator": "GPU", 69 | "colab": { 70 | "gpuType": "T4", 71 | "provenance": [] 72 | }, 73 | "kernelspec": { 74 | "display_name": "Python 3", 75 | "name": "python3" 76 | }, 77 | "language_info": { 78 | "name": "python" 79 | } 80 | }, 81 | "nbformat": 4, 82 | "nbformat_minor": 0 83 | } 84 | -------------------------------------------------------------------------------- /4d_humans_gradio_colab.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": { 6 | "id": "view-in-github" 7 | }, 8 | "source": [ 9 | "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/camenduru/4D-Humans-colab/blob/main/4d_humans_gradio_colab.ipynb)" 10 | ] 11 | }, 12 | { 13 | "cell_type": "code", 14 | "execution_count": null, 15 | "metadata": { 16 | "id": "VjYy0F2gZIPR" 17 | }, 18 | "outputs": [], 19 | "source": [ 20 | "%cd /content\n", 21 | "\n", 22 | "!apt -y install -qq aria2\n", 23 | "\n", 24 | "!git clone -b dev https://github.com/camenduru/HMR2.0-hf\n", 25 | "%cd /content/HMR2.0-hf\n", 26 | "\n", 27 | "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/4D-Humans/resolve/main/HMR2/assets/test1.png -d /content/HMR2.0-hf/assets -o test1.png\n", 28 | "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/4D-Humans/resolve/main/HMR2/logs/train/multiruns/hmr2/0/checkpoints/epoch%3D35-step%3D1000000.ckpt -d /content/HMR2.0-hf/logs/train/multiruns/hmr2/0/checkpoints -o epoch=35-step=1000000.ckpt\n", 29 | "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/4D-Humans/resolve/main/HMR2/data/smpl_mean_params.npz -d /content/HMR2.0-hf/data -o smpl_mean_params.npz\n", 30 | "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/4D-Humans/resolve/main/HMR2/data/SMPL_to_J19.pkl -d /content/HMR2.0-hf/data -o SMPL_to_J19.pkl\n", 31 | "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/4D-Humans/resolve/main/HMR2/data/smpl/basicModel_neutral_lbs_10_207_0_v1.0.0.pkl -d /content/HMR2.0-hf/data/smpl -o basicModel_neutral_lbs_10_207_0_v1.0.0.pkl\n", 32 | "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/4D-Humans/resolve/main/HMR2/data/smpl/SMPL_NEUTRAL.pkl -d /content/HMR2.0-hf/data/smpl -o SMPL_NEUTRAL.pkl\n", 33 | "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/4D-Humans/resolve/main/HMR2/data/smpl/SMPL_MALE.pkl -d /content/HMR2.0-hf/data/smpl -o SMPL_MALE.pkl\n", 34 | "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/4D-Humans/resolve/main/HMR2/data/smpl/SMPL_FEMALE.pkl -d /content/HMR2.0-hf/data/smpl -o SMPL_FEMALE.pkl\n", 35 | "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/4D-Humans/resolve/main/HMR2/data/smpl/priors/gmm_08.pkl -d /content/HMR2.0-hf/data/smpl -o gmm_08.pkl\n", 36 | "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/4D-Humans/resolve/main/model_final_f05665.pkl -d /root/.torch/iopath_cache/detectron2/ViTDet/COCO/cascade_mask_rcnn_vitdet_h/f328730692/ -o model_final_f05665.pkl\n", 37 | "\n", 38 | "!pip install gradio yacs smplx==0.1.28 pytorch-lightning pyrender timm einops\n", 39 | "!pip install https://github.com/camenduru/wheels/releases/download/colab/detectron2-0.6-cp310-cp310-linux_x86_64.whl\n", 40 | "\n", 41 | "import os\n", 42 | "os.environ[\"PYOPENGL_PLATFORM\"] = \"egl\"\n", 43 | "os.environ[\"MESA_GL_VERSION_OVERRIDE\"] = \"4.1\"\n", 44 | "\n", 45 | "# !python app_mesh.py\n", 46 | "!python app.py" 47 | ] 48 | } 49 | ], 50 | "metadata": { 51 | "accelerator": "GPU", 52 | "colab": { 53 | "gpuType": "T4", 54 | "provenance": [] 55 | }, 56 | "kernelspec": { 57 | "display_name": "Python 3", 58 | "name": "python3" 59 | }, 60 | "language_info": { 61 | "name": "python" 62 | } 63 | }, 64 | "nbformat": 4, 65 | "nbformat_minor": 0 66 | } 67 | -------------------------------------------------------------------------------- /4d_humans_video_colab.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": { 6 | "id": "view-in-github" 7 | }, 8 | "source": [ 9 | "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/camenduru/4D-Humans-colab/blob/main/4d_humans_video_colab.ipynb)" 10 | ] 11 | }, 12 | { 13 | "cell_type": "code", 14 | "execution_count": null, 15 | "metadata": { 16 | "id": "VjYy0F2gZIPR" 17 | }, 18 | "outputs": [], 19 | "source": [ 20 | "%cd /content\n", 21 | "!apt -y install -qq aria2\n", 22 | "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/4D-Humans/resolve/main/hmr2_data.tar.gz -d /root/.cache/4DHumans -o hmr2_data.tar.gz\n", 23 | "!tar -xvf /root/.cache/4DHumans/hmr2_data.tar.gz -C /root/.cache/4DHumans\n", 24 | "!git clone -b v1.0 https://github.com/camenduru/4D-Humans\n", 25 | "!pip install -q https://github.com/camenduru/wheels/releases/download/colab/detectron2-0.6-cp310-cp310-linux_x86_64.whl\n", 26 | "!pip install -q gradio yacs smplx==0.1.28 pytorch-lightning pyrender timm einops\n", 27 | "!pip install -q git+https://github.com/camenduru/PHALP@v1.0" 28 | ] 29 | }, 30 | { 31 | "cell_type": "code", 32 | "execution_count": null, 33 | "metadata": {}, 34 | "outputs": [], 35 | "source": [ 36 | "%cd /content/4D-Humans\n", 37 | "!python track.py video.source=\"https://www.youtube.com/watch?v=xEH_5T9jMVU\"" 38 | ] 39 | }, 40 | { 41 | "cell_type": "code", 42 | "execution_count": null, 43 | "metadata": {}, 44 | "outputs": [], 45 | "source": [ 46 | "!aria2c --console-log-level=error -c -x 16 -s 16 -k 1M https://huggingface.co/camenduru/phalp/resolve/main/input.mp4 -d /content -o input.mp4\n", 47 | "%cd /content/4D-Humans\n", 48 | "!python track.py video.source=\"/content/input.mp4\"" 49 | ] 50 | } 51 | ], 52 | "metadata": { 53 | "accelerator": "GPU", 54 | "colab": { 55 | "gpuType": "T4", 56 | "provenance": [] 57 | }, 58 | "kernelspec": { 59 | "display_name": "Python 3", 60 | "name": "python3" 61 | }, 62 | "language_info": { 63 | "name": "python" 64 | } 65 | }, 66 | "nbformat": 4, 67 | "nbformat_minor": 0 68 | } 69 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 🐣 Please follow me for new updates https://twitter.com/camenduru
2 | 🔥 Please join our discord server https://discord.gg/k5BwmmvJJU
3 | 🥳 Please join my patreon community https://patreon.com/camenduru
4 | 5 | ## 🦒 Colab 6 | 7 | | Colab | Info 8 | | --- | --- | 9 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/camenduru/4D-Humans-colab/blob/main/4d_humans_colab.ipynb) | 4d_humans_colab.ipynb 10 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/camenduru/4D-Humans-colab/blob/main/4d_humans_gradio_colab.ipynb) | 4d_humans_gradio_colab.ipynb 11 | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/camenduru/4D-Humans-colab/blob/main/4d_humans_video_colab.ipynb) | 4d_humans_video_colab.ipynb 12 | 13 | ## Main Repo 14 | https://github.com/shubham-goel/4D-Humans
15 | https://github.com/brjathu/PHALP (track)
16 | 17 | ## Page 18 | https://shubham-goel.github.io/4dhumans/
19 | https://brjathu.github.io/PHALP/ (track)
20 | 21 | ## Paper 22 | https://arxiv.org/abs/2305.20091
23 | https://arxiv.org/abs/2112.04477 (track)
24 | 25 | ## Output 26 | 4d_humans_colab 27 | 28 | ![download](https://github.com/camenduru/4D-Humans-colab/assets/54370274/e1c37b0a-8fbe-4a68-b05e-9f7933435cdc) 29 | ![run](https://github.com/camenduru/4D-Humans-colab/assets/54370274/b5721483-0986-4cf0-bc7c-fc3d6b603b95) 30 | 31 | 4d_humans_video_colab
32 | Artist: https://www.youtube.com/@karinabalcerzak 33 | 34 | https://github.com/camenduru/4D-Humans-colab/assets/54370274/37f8189e-67c5-4192-aefd-3f1a26d2f4c0 35 | --------------------------------------------------------------------------------