Giter VIP home page Giter VIP logo

rpi_pose_estimation's Introduction

INFO: Created TensorFlow Lite XNNPACK delegate for CPU. Program started - waiting for Enter to be pressed... Press Enter to start/stop capture (type 'quit' to exit): Starting capture based on user input. [ WARN:[email protected]] global cap_v4l.cpp:997 open VIDEOIO(V4L2:/dev/video0): can't open camera by index [ERROR:[email protected]] global obsensor_uvc_stream_channel.cpp:159 getStreamChannelGroup Camera index out of range Camera initiated. Running loop Traceback (most recent call last): File "/home/Team4/rpi_pose_estimation/run_pose_estimation.py", line 246, in frame = frame1.copy() ^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'copy'

Pose Estimation on the Raspberry Pi 4

Results

Description of Repository

This repository contains code and instructions to configure the necessary software for running pose estimation on the Raspberry Pi 4!

Details of Software and Neural Network Model for Object Detection:

  • Language: Python
  • Framework: TensorFlow Lite
  • Network: PoseNet with MobileNet-V1

The motivation for the Project

The goal of this project was to how well pose estimation could perform on the Raspberry Pi. Google provides code to run pose estimation on Android and IOS devices - but I wanted to write python code to interface with and test the model on the Pi. For more information checkout my medium post here: https://ecd1012.medium.com/pose-estimation-on-the-raspberry-pi-4-83a02164eb8e

Additional Resources

Testing Configuration

Core

  • Raspberry Pi 4 GB
  • Raspberry Pi 5MP Camera (rev 1.3)

Other

  • LED
  • 470 Ohm Resistor
  • Small breadboard
  • GPIO push button
  • 3.5 Amp USB-C Power Supply

Setting Up Software

1.) Clone Repository:

git clone https://github.com/ecd1012/rpi_pose_estimation.git

2.) Change directory to source code:

cd rpi_pose_estimation

3.) Please see my other post here: https://github.com/ecd1012/rpi_road_object_detection And follow Setting Up Software Steps: 3-9 before proceeding Here is a video of those steps: https://youtu.be/Zfmo3bMycUg

4.)At this point, you should have all the dependencies installed and your virtual environment activated.

5.) Grab the sample TensorFlow Lite Posenet model from Google

wget https://storage.googleapis.com/download.tensorflow.org/models/tflite/posenet_mobilenet_v1_100_257x257_multi_kpt_stripped.tflite

Setting Up Hardware

6.) Please see my other post here: https://github.com/ecd1012/rpi_road_object_detection And follow Setting Up Hardware Steps: 10-12 before proceeding Here is a video of those steps: https://youtu.be/Zfmo3bMycUg

Running Pose Estimation

7.) After all your hardware and software is configured correctly run the following command:

python3 run_pose_estimation.py --modeldir posenet_mobilenet_v1_100_257x257_multi_kpt_stripped.tflite --output_path pose_images

Where the --output_path you specify is where you want images saved.

8.) The script will start running and wait for you to press the GPIO input button to start processing the video feed from the camera. Once you press the button, the green LED will turn on and the pi will start feeding and processing the video stream through the neural network. Processed images will be saved to the '--output_path' you specified over the command line, with a timestamped folder for each button press.

9.) If you like, make a video out of the images. You can do this with gif making software, video making software, or ffmpeg. Help: https://stackoverflow.com/questions/24961127/how-to-create-a-video-from-images-with-ffmpeg Or by using gif maker software: https://ezgif.com/

rpi_pose_estimation's People

Contributors

ecd1012 avatar kxm37 avatar djedgar00 avatar

Forkers

djedgar00

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.