{"id":13710912,"url":"https://github.com/houdinisparks/pose_recognition_tello","last_synced_at":"2025-05-06T20:31:16.141Z","repository":{"id":39854522,"uuid":"142994326","full_name":"houdinisparks/pose_recognition_tello","owner":"houdinisparks","description":"Control a dji tello drone with body postures processed by tf-openpose using a camera and aws ec2 g2.2xlarge gpu server.","archived":false,"fork":false,"pushed_at":"2023-02-15T19:40:31.000Z","size":21878,"stargazers_count":16,"open_issues_count":14,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-13T21:44:43.556Z","etag":null,"topics":["action-recognition","openpose","pose-recognition","tello"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/houdinisparks.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-07-31T09:42:56.000Z","updated_at":"2023-08-13T12:18:35.000Z","dependencies_parsed_at":"2023-02-17T14:01:15.451Z","dependency_job_id":null,"html_url":"https://github.com/houdinisparks/pose_recognition_tello","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houdinisparks%2Fpose_recognition_tello","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houdinisparks%2Fpose_recognition_tello/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houdinisparks%2Fpose_recognition_tello/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houdinisparks%2Fpose_recognition_tello/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/houdinisparks","download_url":"https://codeload.github.com/houdinisparks/pose_recognition_tello/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252764246,"owners_count":21800662,"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":["action-recognition","openpose","pose-recognition","tello"],"created_at":"2024-08-02T23:01:02.147Z","updated_at":"2025-05-06T20:31:15.115Z","avatar_url":"https://github.com/houdinisparks.png","language":"Python","funding_links":[],"categories":["Examples"],"sub_categories":[],"readme":"# Controlling Drone with Body Postures\nA makerfaire 2018 project. \n\n## Overview\n![Architecture](./imgs/architecture.png)\n\n**Prerequisites**\n- Docker\n- AWS EC2 GPU (G2/P2/P3)\n- Additional wireless network adaptor to connect to tello \n- Camera ( pc webcam will do just fine )\n- DJI Tello \n\nI initially developed this with a cpu as a target server  to process the images, but it \nunsurprisingly turned out to be very slow. Also, midway developement I was thinking about \nusing AWS Kinesis Data Streams to stream my video frames to the server, instead of using low level \nsockets. However, it turned out to be quite of a hassle, as I had to think about how to reorder \nthe frames as they arrive after being processed in the server. As such, you will see many different configuration \nand environment files lying around in this repo, you don't have to pay attention to them. Just \nfollow the steps below and you should be on your way to moving the drones with your hands! :)\n\n## 1) Setup the environment\n```powershell\n# create your venv folder\npython -m venv venv\ncall venv/Scripts/activate.bat\n\n# install your requirements\npip install -r requirements_gpu.txt\n\n# install the tf-openpose lib\n# ref: https://github.com/ildoonet/tf-pose-estimation#install-1\ngit clone https://github.com/ildoonet/tf-pose-estimation.git\ncd tf-openpose\npython setup.py install\ncd tf_pose/pafprocess\nswig -python -c++ pafprocess.i \u0026\u0026 python3 setup.py build_ext --inplace\n\n```\n\n\n## 2) Setup the AWS GPU EC2\nI used docker-machine to help me setup the aws gpu machine. I recommend using it, it is a very convenient tool for\nlaunching and deploying your docker containers to AWS.\n\n**Open powershell**\n```powershell\n# Create and launch the aws ec2\ndocker-machine create \n--driver amazonec2 \n--amazonec2-region \u003cyour-region\u003e \n--amazonec2-instance-type g2.2xlarge\n\u003cmachine-name\u003e\n```\n\nAWS machine will be created with with these default values if extra settings is not set during creation:\n - amazonec2-root-size \u003c16gbs\u003e\n - amazonec2-ami \u003ca base ubuntu 16.04\u003e\n\n**Setup latest cuda driver and nvidia-docker 2.0**\n```powershell\n# Restart the instance first, to be sure we are running the latest installed kernel\ndocker-machine restart \u003cmachine-name\u003e\n\n# SSH into the machine\ndocker-machine ssh \u003cmachine-name\u003e\n\n# Install official NVIDIA driver package\nsudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub\nsudo sh -c 'echo \"deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 /\" \u003e /etc/apt/sources.list.d/cuda.list'\nsudo apt-get update \u0026\u0026 sudo apt-get install -y --no-install-recommends linux-headers-generic dkms cuda-drivers\n\n# Create the docker group and add your user\nsudo groupadd docker\nsudo usermod -aG docker $USER\n\n# Log out and log back in so that your group membership is re-evaluated.\nexit\ndocker-machine ssh \u003cmachine-name\u003e\n\n# Add the nvidia-docker 2.0 package repositories\ncurl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \\\n  sudo apt-key add -\ndistribution=$(. /etc/os-release;echo $ID$VERSION_ID)\ncurl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \\\n  sudo tee /etc/apt/sources.list.d/nvidia-docker.list\nsudo apt-get update\n\n# Install nvidia-docker2 and reload the Docker daemon configuration\nsudo apt-get install -y nvidia-docker2\nsudo pkill -SIGHUP dockerd\n\n# Test nvidia-smi with the latest official CUDA image\ndocker run --runtime=nvidia --rm nvidia/cuda nvidia-smi\n\n# Exit the machine\nexit\n```\n\n## 3) Run the image processing server on AWS\nOpen up powershell and enter the following command\n\n```powershell\ncd \u003cpath to project directory\u003e\ndocker-machine start \u003cmachine-name\u003e\ndocker-machine env \u003cmachine-name\u003e | Invoke-Expression\n\n# stop all running containers just in case one of them is already using pot 8089\ndocker stop $(docker ps -aq)\ndocker run --runtime=nvidia -it --rm -p 8089:8089 houdinisparks/pose_recogniser:mf-gpu-30stimeout\n```\n\nYou should see the following output:\n\n```powershell\n('2018-08-01 04:29:12,415 - __main__ - MainThread - INFO - Socket successfuly created and binded to 0.0.0.0:8089\n('2018-08-01 04:29:12,416 - __main__ - MainThread - INFO - Listening for connections...\n```\n\n\n## 4)  Run the web application\nOpen up another console on your pc.\n\n```powershell\ncd \u003cpath to project directory\u003e\npython -m src.webapp.app\n```\n\n```powershell\n# Output on console\n('2018-08-01 12:33:33,305 - werkzeug - Thread-1 - INFO -  * Running on http://127.0.0.1:5001/ (Press CTRL+C to quit)\n```\n\n#### Webpage   \n![Web Page](./imgs/step_1.png)\n\n#### Demo of the poses recognized \n![Poses](imgs/poses1.gif)\n\n6 poses: takeoff, land, left, right, flip_forward, flip_backward.  \n**EDIT**\n2 more poses added: back and front. |_ (left shoulder) for back, and _| (right shoulder) for front\n\n## 5) Setup the tello connection\nTurn on the tello and connect to the tello's wifi (You need to attach another wifi adapter to connect \nto a 2nd wifi network. It's cheap, I bought mine for SGD 6 from Lazada.) \nClick on the \"Connect to Tello\" button on the webpage.\n\n![Web Page](./imgs/step_2.png)\n\n**EDIT**\nYou might need to click the connect button a few times before its connected.\n\nAnd you are done! :D\n\n## 6) Libraries Use\ntf-openpose  \nopencv","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoudinisparks%2Fpose_recognition_tello","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoudinisparks%2Fpose_recognition_tello","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoudinisparks%2Fpose_recognition_tello/lists"}