Skip to content

Mediapipe is a Python-based project that leverages the power of MediaPipe, OpenCV, and WebSockets to perform real-time video processing and hand tracking. This project is designed to process video frames, detect hand landmarks, classify hand types, and broadcast data using WebSockets for further processing or display.

License

Notifications You must be signed in to change notification settings

cagatay-softgineer/MediaPipe

Repository files navigation

MediaPipe Hand, Pose, and Face Detection

This project demonstrates the usage of MediaPipe for hand, pose, and face detection in videos.

Language Stats:

  • Python: 39660 bytes
  • HTML: 2905 bytes
  • Jupyter Notebook: 691 bytes

Total Size Of Project : 13433 kilobytes

Total Lines Of Code : 1302

End of Language Stats

Features

  • Detects hand, pose, and face landmarks using MediaPipe.
  • Displays the detected landmarks overlaid on the video frames.
  • Supports resizing frames to fit the screen while maintaining aspect ratio.
  • Displays the name of the video file as a text overlay on the frames.

Requirements

  • Python 3.x
  • OpenCV
  • MediaPipe

Installation

  1. Clone this repository:
git clone https://github.com/cagatay-softgineer/MediaPipe.git
  1. Install the required libraries:
pip install opencv-python mediapipe websockets

Usage

  1. Place your video files in the videos directory.
  2. Update the Video Path in main.py.
useMediaPipe("videos/Test.mp4")
  1. Run the main.py script:
python main.py
  1. Press 'q' to exit the program.

WebSocket Usage

1. Start the WebSocket Server:

  • Navigate to the WebSocketServer folder.

FOR WINDOWS

  • Run the executable websoc.exe file to start the WebSocket server.

FOR MACOS OR LINUX

  • Create a script for run websocket.py
python3 websoc.py # Use python if not working with python3
  • Save the file with a .sh extension, for example run_websoc.sh
  • Make the Script
  • Open Terminal.
  • Navigate to the directory where you saved run_websoc.sh.
  • Make the script executable by running the following command
chmod +x run_websoc.sh
  • Run the Script
./run_websoc.sh

2. Add Send2WSS=True to:

useMediaPipe("videos/Test.mp4",Send2WSS=True)

Customization

  • You can customize the screen width and height in the useMediaPipe function to adjust the size of the displayed frames.
  • Additional customization can be done by modifying the code in modelUsageTests.py according to your requirements.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

This project utilizes the following third-party applications and libraries

- MediaPipe library developed by Google.

alt text

- Blender

alt text

About

Mediapipe is a Python-based project that leverages the power of MediaPipe, OpenCV, and WebSockets to perform real-time video processing and hand tracking. This project is designed to process video frames, detect hand landmarks, classify hand types, and broadcast data using WebSockets for further processing or display.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published