Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robertboy18/blinkeyepython
Run Python programs by blinking twice
https://github.com/robertboy18/blinkeyepython
blink blink-detection-algorithm detection fun opencv project python visualrecognition
Last synced: about 2 hours ago
JSON representation
Run Python programs by blinking twice
- Host: GitHub
- URL: https://github.com/robertboy18/blinkeyepython
- Owner: Robertboy18
- License: gpl-3.0
- Created: 2020-12-30T16:56:10.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2020-12-30T17:58:49.000Z (almost 4 years ago)
- Last Synced: 2023-04-26T05:03:57.303Z (over 1 year ago)
- Topics: blink, blink-detection-algorithm, detection, fun, opencv, project, python, visualrecognition
- Language: Jupyter Notebook
- Homepage:
- Size: 295 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BlinkEyePython
This project was created just for fun during a chat with some of the other interns in the Microsoft Group. One of them suggested an idea Imagine blinking to compile.This sparked my interest and after doing some research I finally created this file which does the same exact thing except its a double blink to run. It's not completely fool proof yet but feel free to open issues and suggest more ideas on how to make it a fullproof project.
**Important Modules to Install**
```python
# Import the required modules
import pyttsx3 # text to speech
import pyautogui # keyboard control
import winsound # sound
import numpy as np
import cv2
```
**Blinking Eye Detection Reference and important files to add**
Reference: [Github link](https://github.com/infoaryan/Eye-blink-detection-game)
**Compile and Run**
Step 1 : Add these two relevant files to the same folder the python/jupyter-notebook is in.
Files 1.1 haarcascade_eye_tree_eyeglasses.xml
Files 1.2 haarcascade_frontalface_default.xmlStep 2 (Skip to step 3 if running on terminal or as a python file) : If running in Jupyter Notebook, execute the first 5 cells only. The following 5th cell is this ( Save the python files in the same folder as the rest of the xml files and the main python file/jupyter notebook.) Enter the names with the .py extension seperated by space.
```python
# enter the python file names seperated by a space
file = input("Please enter the file name : ").split()
pyautogui.press('down') # automatically goes to the next cell
pyautogui.hotkey('ctrl', 'enter') # executes the following cell
```Example : hello.py redd.py intern.py
Step 3 : Enter the python file names again with the .py extension seperated by space.
Step 4 : Minimize the video capture tab/ keep it open
Step 5 : There will be 3 voice memos each explaining the command.
Step 6 : After the eyes are detected and a first blink is captured a prompt message will be spoken which asks for another blink , if one chooses not to blink, press q to exit or just continue programming in the side.
Step 7 : Double blink to run the file (give it a 1 second break between each blink as cv2 is a bit slow in capturing successive frames and doing detection)
Step 8 : Voila all the programs run sequentially, if your python files contain input prompts enter the required value and see the magic on it compiling all the rest of the files on its own.
**Spoiler**
Again this was just a fun project and am open to suggestions on how to edit this and make it full proof and add more features.
- Robert