Skip to content

aarav2you/nyu-abu-dhabi-pose-estimation

Repository files navigation

Guide for pose estimation for NYU Abhu Dhabi 2024 with Dr. Moore

Live webcam pose estimation

This will use your webcam to perform single person pose estimation at real time. Follow the steps given below for your operating system:

Windows 10/11

  1. Click here to download Docker Desktop into your Downloads folder

  2. Press Win+R

  3. Type powershell and press Ctrl+Shift+Enter

  4. Execute the following commands by pasting them into powershell and pressing enter:

    a. wsl --install -n -d Ubuntu

    b. Invoke-WebRequest -Uri "https://raw.githubusercontent.com/aarav2you/nyu-abu-dhabi-pose-estimation/main/fixWSL.reg" -OutFile "$env:TEMP\fixWSL.reg"; Start-Process -filepath "$env:windir\regedit.exe" -Argumentlist @("/s", "`"$env:TEMP\fixWSL.reg`"")

  5. Open the newly installed Ubuntu app, wait for it to install and then close it

  6. Execute the following commands in powershell:

    a. cd Downloads

    b. & '.\Docker Desktop Installer.exe' install --accept-license

  7. Proceed through the installation

  8. Open the newly installed app called Docker Desktop

  9. Click 'Continue without signing in' and then click 'Skip'

  10. Press Win+R

  11. Type powershell and press enter

  12. Wait for docker engine to start, then execute the following commands:

    a. docker pull archav2you/track (this downloads the pose estimation software)

    b. docker run -p 1234:1234 archav2you/track (this runs the pose estimation software, so execute this command when you need to run the pose estimation software again, and make sure docker desktop is running beforehand)

  13. When you see Built in <whatever> seconds, go to localhost:1234/?model=movenet in your web browser.

  14. Allow camera and wait for it to load

  15. (Optional): Change the type to thunder for more accurate pose estimation

  16. Close the powershell window to stop the software

Removing the software

  1. Press Win+R

  2. Type powershell and press enter

  3. Execute the following commands:

    a. docker rm -f $(docker ps -a -q --filter ancestor=archav2you/track)

    b. docker rm -f $(docker ps -a -q --filter ancestor=archav2you/track)

  4. Uninstall Docker Desktop

MacOS

  1. Open the terminal app. For the following steps, enter password when prompted.

  2. Execute the following commands by pasting them into terminal and pressing enter:

    a. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" (this will install Homebrew)

    b. (echo; echo 'eval $(/opt/homebrew/bin/brew shellenv)') >> ~/.zprofile

    c. eval $(/opt/homebrew/bin/brew shellenv)"

  3. Wait for the command to finish, then execute the following command:

    brew install --cask docker

  4. Wait for the command to finish, bring up the MacOS spotlight and open the newly installed app called Docker

  5. Click 'Continue without signing in' and then click 'Skip'

  6. Wait for docker engine to start, then execute the following commands:

    a. docker pull archav2you/track (this downloads the pose estimation software)

    b. docker run -p 1234:1234 archav2you/track (this runs the pose estimation software, so execute when you need to run again)

  7. When you see Built in <whatever> seconds, go to localhost:1234/?model=movenet in your web browser.

  8. Allow camera and wait for it to load

  9. (Optional): Change the type to thunder for more accurate pose estimation

  10. Close the terminal window to stop the software

Removing the software

It is reccomended to not remove the software yet so you can run pose estimation in video files (scroll down below)

  1. Execute the following commands in terminal:

    a. docker rm -f $(docker ps -a -q --filter ancestor=archav2you/track)

    b. docker image rm archav2you/track

  2. Uninstall the Docker app

  3. Uninstall homebrew by executing the following command:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"

  4. Unintsall Xcode by executing the following command:

    sudo rm -r /Library/Developer/CommandLineTools

Video upload pose estimation

This will use a video you specify to perform multi person pose estimation. Follow the steps given below for your operating system:

Windows 10/11

  1. Press Win+R

  2. Type powershell and press enter

  3. Make sure Docker is installed from the steps above

  4. Make sure Docker Desktop is running by opening the Docker app

  5. Click here to install python, and proceed through the installation, and make sure you have enabled the Add Python 3.11 to PATH checkbox

  6. Execute the following commands in the powershell:

    a. cd Downloads

    b. Expand-Archive -Path ".\ffmpeg-6.1.1-full_build.zip" -DestinationPath .

    c. pwd

  7. Copy the output of the pwd command, then replace PWD_OUTPUT_HERE with the output for the following command, which you need to execute by pressing Win+R, typing powershell, and pressing Ctrl+Shift+Enter: Move-Item -Path "PWD_OUTPUT_HERE\ffmpeg-6.1.1-full_build\bin\*" -Destination "C:\Windows\System32"

    c. docker run -p 7070:7070 archav2you/video-trackhttps://github.com/GyanD/codexffmpeg/releases/download/6.1.1/ffmpeg-6.1.1-full_build.zip

  8. Press Win+R

  9. Type powershell and press enter

  10. Execute the following commands:

    a. cd Downloads\

    b. Invoke-WebRequest "https://github.com/aarav2you/nyu-abu-dhabi-pose-estimation/archive/refs/heads/main.zip" -OutFile .\nyu-abu-dhabi-pose-estimation.zip

    c. Expand-Archive -Path .\nyu-abu-dhabi-pose-estimation.zip -DestinationPath .\

    d. cd nyu-abu-dhabi-pose-estimation-main\

    e. py -m venv venv

    f. source venv/bin/activate

    g. py -m pip install -r requirements.txt

    h. py -m pip install streamlit

    i. Invoke-WebRequest "https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-w6-pose.pt" -OutFile .\yolov7-w6-pose.pt

    j. streamlit run main.py

  11. Go to localhost:7070 in your web browser.

  12. Upload the video, when done the video will be played on the webpage and can be downloaded

Removing the software

  1. Delete the nyu-abu-dhabi-pose-estimation-main folder in your Downloads folder
  2. Uninstall the Python app

MacOS

  1. Open terminal

  2. Execute the following commands:

    a. python3 -m pip install --upgrade pip

    b. cd Downloads

    c. git clone https://github.com/aarav2you/nyu-abu-dhabi-pose-estimation video-track

    d. cd video-track

    e. python3 -m venv venv

    f. source venv/bin/activate

    g. python3 -m pip install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu

    h. python3 -m pip install -r requirements.txt

    i. python3 -m pip install streamlit

    j. brew install ffmpeg wget

    k. wget "https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7-w6-pose.pt"

    l. streamlit run main.py

  3. Go to localhost:7070 in your web browser.

  4. Upload the video, when done the video will be played on the webpage and can be downloaded

Removing the software

Execute the following command in terminal: rm -r ~/Downloads/video-track

About

Pose estimation for NYU Abu Dhabi class of 2024 with Dr. Moore

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published