GithubHelp home page GithubHelp logo

fingerpy's Introduction

FingerPy - Mouth Detection and Video Control

written by Daniel Andrade.

Overview

FingerPy is a Python application that plays video files and uses computer vision to automatically pause or resume playback based on hand gestures. Specifically, the application detects if the user places their hand near their head and pauses the video accordingly. Resuming playback is as simple as moving the hand away from the head.

Dependencies

  • OpenCV (cv2)
  • Python-VLC (vlc)
  • time
  • os
  • glob
  • MediaPipe (mediapipe)
  • keyboard

To install these dependencies, use the following pip command:

pip install opencv-python python-vlc mediapipe keyboard

Code Structure

The code consists of three main functions:

  1. hand_near_head(landmarks, face_landmarks): Determines if a hand is near the head based on the given landmarks.
  2. play_video(video_path): Plays a video from the specified path and processes the hand gestures for controlling playback.
  3. main(): Searches for video files in the specified folder and plays them in order.

Usage

To run FingerPy, simply execute the Python script with your preferred Python interpreter. For example:

python fingerpy.py

The script will search for video files in the specified folder (video_folder) and play them one by one. While the video is playing, bring your hand close to your head to pause the video, and move it away to resume playback. To exit the application, press the 'ESC' key.

Customization

You can change the video_folder variable in the main() function to point to your desired video folder. By default, the script searches for .mp4 video files. To support other video formats, modify the file extension in the glob.glob() function call within the main() function.

Written with StackEdit.

fingerpy's People

Contributors

danielboomera avatar

Watchers

 avatar

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.