{"id":20458612,"url":"https://github.com/pupil-labs/densepose-module","last_synced_at":"2025-04-13T05:45:23.862Z","repository":{"id":117922347,"uuid":"552931632","full_name":"pupil-labs/densepose-module","owner":"pupil-labs","description":"Implementation of detectron2 denspose estimation with acknowledgement of body parts gazed.","archived":false,"fork":false,"pushed_at":"2024-10-30T14:19:34.000Z","size":266,"stargazers_count":6,"open_issues_count":2,"forks_count":0,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-13T05:45:21.822Z","etag":null,"topics":["densepose","eye-tracking","pupil"],"latest_commit_sha":null,"homepage":"http://densepose-module.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pupil-labs.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-17T12:59:58.000Z","updated_at":"2025-03-26T23:57:00.000Z","dependencies_parsed_at":"2024-01-12T11:24:59.091Z","dependency_job_id":"77fb074e-3c7f-4b43-b6ea-55a962095676","html_url":"https://github.com/pupil-labs/densepose-module","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pupil-labs%2Fdensepose-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pupil-labs%2Fdensepose-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pupil-labs%2Fdensepose-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pupil-labs%2Fdensepose-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pupil-labs","download_url":"https://codeload.github.com/pupil-labs/densepose-module/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248670520,"owners_count":21142901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["densepose","eye-tracking","pupil"],"created_at":"2024-11-15T12:13:13.737Z","updated_at":"2025-04-13T05:45:23.839Z","avatar_url":"https://github.com/pupil-labs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n   :target: https://github.com/psf/black\n   :alt: Code style: Black\n\n.. .. image:: https://readthedocs.org/projects/skeleton/badge/?version=latest\n..    :target: https://skeleton.readthedocs.io/en/latest/?badge=latest\n\n.. image:: https://img.shields.io/badge/skeleton-2022-informational\n   :target: https://blog.jaraco.com/skeleton\n\nIntroduction\n============\n\nThis project allows you to use DensePose from detectron2 together with Pupil Invisible / Neon's recordings.\nIt generates a new visualization with denseposes overlaid on the video and gaze on top, and also generates a new CSV file with the body parts gazed and body heatmap.\n\nRequirements\n============\nYou should have, Linux or MacOS and Python 3.9 or higher installed on your system.\nThis file assumes a minimum technical knowledge of the command line and Python, if you are not familiar we recommend that you use our Google Colab notebook instead.\n\n.. image:: https://img.shields.io/static/v1?label=\u0026message=Open%20in%20Google%20Colab\u0026color=blue\u0026labelColor=grey\u0026logo=Google%20Colab\u0026logoColor=#F9AB00\n   :target: https://colab.research.google.com/drive/1s6mBNAhcnxhJlqxeaQ2IZMk_Ca381p25?usp=sharing\n\nInstallation\n============\n\nFollow these steps to install and use the `pupil-labs-dense-pose` module:\n\nOn MacOS (using the CPU)\n\n1. Open a terminal window.\n\n2. Run the following commands. For easiness, we will use the astral/uv package manager. You can install it in your system by:\n\n.. code-block:: bash\n\n    curl -LsSf https://astral.sh/uv/install.sh | sh\n\nMacOS (Python 3.11)\n-------------------\nIn MacOS we can only use the CPU version of detectron2, when installing it from Meta's repository there are some issues that you may find. So we will use @johnnynunez's version of detectron2 that works with the latest pytorch version.\n\n.. code-block:: bash\n\n      # Optional, but recommended, run it on a virtual environment\n      uv venv --seed --python python3.11 --exclude-newer=\"2024-03-14\"\n      source .venv/bin/activate\n      uv pip install -U pip setuptools wheel\n      \n      # Install torch and torchvision\n      uv pip install torch==2.0.1 torchvision==0.15.2\n\n      # Now, we install detectron2, Meta hasn't updated it to run with the latest Pytorch version, but thanks to @johnnynunez\n      # we have a version that works with the latest. Grab the wheels for your version at https://github.com/johnnynunez/detectron2/actions/workflows/build-wheels.yml\n      # select the latest run for your system and matching Pytorch.\n      # Install them with pip, you will need to point to the wheel you downloaded, e.g.:\n\n      uv pip install detectron2-0.7-cp311-cp311-macosx_10_9_universal2.whl\n\n      # This will also avoid issues with poetry from Python, giving you errors with the torch module not being found even though it is installed.\n      # Now, we install densepose\n\n      export FORCE_CUDA=\"0\" # as we don't have CUDA\n      uv pip install git+https://github.com/johnnynunez/detectron2@main#subdirectory=projects/DensePose --no-build-isolation --exclude-newer=\"2024-03-14\"\n\n      # Now we install the module\n      uv pip install git+https://github.com/pupil-labs/densepose-module --exclude-newer=\"2024-03-14\"\n      # And that's it!\n\nLinux (Python 3.11)\n-------------------\nOn Linux, we can run inference on either the CPU or the GPU (if we have CUDA installed). If you want to run it on the CPU, follow these steps:\n\nCPU:\n----\n\n.. code-block:: bash\n\n      # Optional, but recommended, run it on a virtual environment\n      uv venv --seed --python python3.11 --exclude-newer=\"2024-03-14\"\n      source .venv/bin/activate\n      uv pip install -U pip setuptools wheel\n      \n      # Install torch and torchvision\n      uv pip install torch==2.0.1 torchvision==0.15.2\n\n      # Now, we install detectron2, Meta hasn't update it to run with the latest pytorch version, but thanks to @johnnynunez\n      # we have a version that works with the latest. Grab the wheels for your version at https://github.com/johnnynunez/detectron2/actions/workflows/build-wheels.yml\n      # and install them with pip, you will need to point to the wheel you downloaded, e.g.:\n\n      uv pip install detectron2-3.11-pytorch2.0.1-ubuntu-latest-wheel.whl\n\n      export FORCE_CUDA=\"0\" # as we don't have CUDA\n      uv pip install git+https://github.com/johnnynunez/detectron2@main#subdirectory=projects/DensePose --no-build-isolation --exclude-newer=\"2024-03-14\"\n\n      # Now we install the module\n      uv pip install git+https://github.com/pupil-labs/densepose-module.git --exclude-newer=\"2024-03-14\"\n      # And that's it!\n\nGPU:\n----\n\n.. code-block:: bash\n\n      # Optional, but recommended, run it on a virtual environment\n      uv venv --seed --python python3.11 --exclude-newer=\"2024-03-14\"\n      source .venv/bin/activate\n      uv pip install -U pip setuptools wheel\n      \n      # Install torch and torchvision\n      uv pip install torch+cu torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118\n\n      # Now, we install detectron2, Meta hasn't update to run with the latest pytorch version, but thanks to @johnnynunez\n      # we have a version that works with the latest. There are wheels for cuda 11.8 and pytorch 2.01 at \n      #(https://app.circleci.com/pipelines/github/facebookresearch/detectron2/2924/workflows/9f85ee27-173e-494c-b699-8ceb110a3398/jobs/14336/artifacts)\n      # if you use a different version you will need to build it yourself.\n\n      uv pip install detectron2-0.7-cp311-cp311-linux_x86_64.whl\n      #or to try building your own wheels:\n      uv pip install git+https://github.com/johnnynunez/detectron2.git --exclude-newer=\"2024-03-14\"\n\n      export FORCE_CUDA=\"1\" # as we want to use CUDA\n      # We might also need to specify the CUDA home directory\n      # like export CUDA_HOME=\"/usr/local/cuda-11.8\"\n\n      uv pip install git+https://github.com/johnnynunez/detectron2@main#subdirectory=projects/DensePose --no-build-isolation --exclude-newer=\"2024-03-14\"\n\n      # Now we install the module\n      uv pip install git+https://github.com/pupil-labs/densepose-module --exclude-newer=\"2024-03-14\"\n      # And that's it!\n\n\nRunning the Module\n==================\n\nTo run the `pupil-labs-dense-pose` module, execute the following command:\n\n.. code-block:: bash\n\n   pl-densepose\n\n\nChecking the arguments\n----------------------\n\n.. code-block:: bash\n\n   pl-densepose -h\n\n\nArguments\n=========\n\nYou can also provide additional options while running the command. For example, to specify the input and output paths, use the `--input_path` and `--output_path` options. Additionally, you can use the `--device` option to specify the device to be used (e.g., `cpu` or `cuda` for GPU).\nOr the size of the gaze circle used to determine the gazed parts.\n\nFor a detailed description of available arguments and information about where inference is happening, refer to the `docs \u003chttp://densepose-module.readthedocs.io/\u003e`_ or our `alpha lab article \u003chttps://docs.pupil-labs.com/alpha-lab/dense-pose/\u003e`_\n\nFeel free to reach out if you have any questions or need further assistance.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpupil-labs%2Fdensepose-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpupil-labs%2Fdensepose-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpupil-labs%2Fdensepose-module/lists"}