File tree Expand file tree Collapse file tree 4 files changed +299
-0
lines changed
Expand file tree Collapse file tree 4 files changed +299
-0
lines changed Original file line number Diff line number Diff line change 1+ # Your Auto Scroller
2+ hey you tired of using your hands and mouse for scroling? <br >
3+ if yes then you are at the right spot here is gift from me to save your hand
4+
5+ ## Instructions
6+ make sure you piped all the modules from requirments.txt
7+ <br >
8+ ` pip install requirments.txt `
9+ <br >
10+ now run this main.py file in your terminal and use head gestures for scroling
11+ <br >
12+
Original file line number Diff line number Diff line change 1+ import mediapipe as mp
2+ import pyautogui as pd
3+ import cv2
4+ height = 480
5+ width = 640
6+
7+
8+
9+
10+ dix = 1920
11+ diy = 1080
12+ cap = cv2 .VideoCapture (0 )
13+
14+ while True :
15+ state , frame = cap .read ()
16+ frame = cv2 .flip (frame ,1 )
17+ frame = cv2 .resize (frame ,(640 ,480 ))
18+
19+
20+
21+ new_frame = cv2 .cvtColor (frame , cv2 .COLOR_BGR2RGB )
22+ with mp .solutions .hands .Hands (max_num_hands = 1 ,min_detection_confidence = 0.3 ) as hands :
23+ results = hands .process (new_frame )
24+
25+ if results .multi_hand_landmarks :
26+ for handmarker in results . multi_hand_landmarks :
27+ landmarks = handmarker .landmark [8 ]
28+
29+ x = int (landmarks .x * 1980 )
30+ y = int (landmarks .y * 1100 )
31+ z = int (landmarks .z * 100 )
32+ if y < 400 :
33+ pd .scroll (5 )
34+
35+ if y > 590 :
36+ pd .scroll (- 5 )
37+
38+
39+
40+
41+
42+ cv2 .imshow ("frame" ,frame )
43+
44+ if cv2 .waitKey (2 ) & 0xFF == ord ("d" ):
45+ break
46+ cv2 .destroyAllWindows ()
Original file line number Diff line number Diff line change 1+ import cv2
2+ import mediapipe as mp
3+ import pyautogui as pd
4+
5+
6+ face_mesh = mp .solutions .face_mesh .FaceMesh (max_num_faces = 1 )
7+
8+ frame_width = 640
9+ frame_height = 480
10+
11+ cap = cv2 .VideoCapture (0 )
12+
13+ while True :
14+
15+ _ , frame = cap .read ()
16+
17+ frame = cv2 .flip (frame ,1 )
18+ frame = cv2 .resize (frame , (frame_width , frame_height ))
19+
20+
21+ new_frame = cv2 .cvtColor (frame , cv2 .COLOR_BGR2RGB )
22+
23+
24+ output = face_mesh .process (new_frame )
25+ landmarks_points = output .multi_face_landmarks
26+
27+
28+ if landmarks_points :
29+ landmarks = landmarks_points [0 ].landmark
30+
31+
32+ x = int (landmarks [1 ].x * frame_width )
33+ y = int (landmarks [1 ].y * frame_height )
34+ if y < 200 :
35+ pd .press ("up" )
36+ elif y > 250 :
37+ pd .press ("down" )
38+ if x > 320 :
39+ pd .press ("right" )
40+
41+
42+ elif x < 180 :
43+
44+ pd .press ("left" )
45+
46+
47+
48+
49+
50+ cv2 .imshow ("face" , frame )
51+
52+
53+ if cv2 .waitKey (2 ) & 0xFF == ord ("d" ):
54+ break
55+
56+
57+ cap .release ()
58+ cv2 .destroyAllWindows ()
Original file line number Diff line number Diff line change 1+ absl-py==2.0.0
2+ aiohttp==3.8.5
3+ aiosignal==1.3.1
4+ apturl==0.5.2
5+ asttokens==2.2.1
6+ async-timeout==4.0.3
7+ attrs==23.1.0
8+ backcall==0.2.0
9+ bcrypt==3.2.0
10+ beautifulsoup4==4.12.2
11+ blinker==1.4
12+ boto3==1.28.30
13+ botocore==1.31.30
14+ Brlapi==0.8.3
15+ bs4==0.0.1
16+ caer==2.0.8
17+ certifi==2020.6.20
18+ cffi==1.16.0
19+ chardet==4.0.0
20+ charset-normalizer==3.2.0
21+ click==8.0.3
22+ colorama==0.4.4
23+ comm==0.1.4
24+ command-not-found==0.3
25+ contourpy==1.1.1
26+ cryptography==3.4.8
27+ cupshelpers==1.0
28+ cycler==0.12.0
29+ dataclasses-json==0.5.14
30+ dbus-python==1.2.18
31+ debugpy==1.6.7
32+ decorator==5.1.1
33+ defer==1.0.6
34+ discord==2.3.2
35+ discord.py==2.3.2
36+ distlib==0.3.4
37+ distro==1.7.0
38+ distro-info==1.1+ubuntu0.1
39+ duplicity==0.8.21
40+ EasyProcess==1.1
41+ entrypoint2==1.1
42+ et-xmlfile==1.1.0
43+ exceptiongroup==1.1.3
44+ executing==1.2.0
45+ fasteners==0.14.1
46+ filelock==3.6.0
47+ flatbuffers==23.5.26
48+ fonttools==4.43.1
49+ frozenlist==1.4.0
50+ future==0.18.2
51+ greenlet==2.0.2
52+ httplib2==0.20.2
53+ idna==3.3
54+ importlib-metadata==4.6.4
55+ iniconfig==2.0.0
56+ ipykernel==6.25.0
57+ ipython==8.14.0
58+ jedi==0.19.0
59+ jeepney==0.7.1
60+ jmespath==1.0.1
61+ jupyter_client==8.3.0
62+ jupyter_core==5.3.1
63+ keyring==23.5.0
64+ kiwisolver==1.4.5
65+ langchain==0.0.264
66+ langsmith==0.0.22
67+ language-selector==0.1
68+ launchpadlib==1.10.16
69+ lazr.restfulclient==0.14.4
70+ lazr.uri==1.0.6
71+ lockfile==0.12.2
72+ louis==3.20.0
73+ lxml==4.9.3
74+ macaroonbakery==1.3.1
75+ marshmallow==3.20.1
76+ matplotlib==3.8.0
77+ matplotlib-inline==0.1.6
78+ mediapipe==0.10.5
79+ monotonic==1.6
80+ more-itertools==8.10.0
81+ MouseInfo==0.1.3
82+ mss==9.0.1
83+ multidict==6.0.4
84+ mypy==1.5.1
85+ mypy-extensions==1.0.0
86+ nest-asyncio==1.5.7
87+ netifaces==0.11.0
88+ numexpr==2.8.5
89+ numpy==1.25.2
90+ oauthlib==3.2.0
91+ olefile==0.46
92+ openai==0.27.8
93+ openapi-schema-pydantic==1.2.4
94+ opencv-contrib-python==4.8.1.78
95+ opencv-python==4.8.0.76
96+ openpyxl==3.1.2
97+ packaging==23.1
98+ pandas==2.0.3
99+ paramiko==2.9.3
100+ parso==0.8.3
101+ pexpect==4.8.0
102+ pickleshare==0.7.5
103+ Pillow==10.0.0
104+ pipenv==11.9.0
105+ platformdirs==3.10.0
106+ pluggy==1.2.0
107+ prompt-toolkit==3.0.39
108+ protobuf==3.12.4
109+ psutil==5.9.5
110+ ptyprocess==0.7.0
111+ pure-eval==0.2.2
112+ PyAutoGUI==0.9.54
113+ pycairo==1.20.1
114+ pycparser==2.21
115+ pycryptodome==3.18.0
116+ pycups==2.0.1
117+ pydantic==1.10.12
118+ PyDirectInput==1.0.4
119+ pydirectinput-rgx==2.0.8
120+ PyGetWindow==0.0.9
121+ Pygments==2.15.1
122+ PyGObject==3.42.1
123+ PyJWT==2.3.0
124+ pymacaroons==0.13.0
125+ PyMsgBox==1.0.9
126+ PyNaCl==1.5.0
127+ pyope==0.2.2
128+ pyparsing==2.4.7
129+ PyPDF2==3.0.1
130+ pyperclip==1.8.2
131+ PyRect==0.2.0
132+ pyRFC3339==1.1
133+ pyscreenshot==3.1
134+ PyScreeze==0.1.29
135+ PySide6==6.5.2
136+ PySide6-Addons==6.5.2
137+ PySide6-Essentials==6.5.2
138+ pytest==7.4.0
139+ python-apt==2.4.0+ubuntu2
140+ python-dateutil==2.8.2
141+ python-debian==0.1.43+ubuntu1.1
142+ python-dotenv==1.0.0
143+ python3-xlib==0.15
144+ pytweening==1.0.7
145+ pytz==2022.1
146+ pyxdg==0.27
147+ PyYAML==5.4.1
148+ pyzmq==25.1.0
149+ reportlab==3.6.8
150+ requests==2.25.1
151+ s3transfer==0.6.2
152+ secret==0.8
153+ SecretStorage==3.3.1
154+ shiboken6==6.5.2
155+ six==1.16.0
156+ sounddevice==0.4.6
157+ soupsieve==2.4.1
158+ SQLAlchemy==2.0.19
159+ stack-data==0.6.2
160+ systemd-python==234
161+ tabulate==0.9.0
162+ tenacity==8.2.3
163+ tomli==2.0.1
164+ tornado==6.3.2
165+ tqdm==4.66.1
166+ traitlets==5.9.0
167+ typing-inspect==0.9.0
168+ typing_extensions==4.7.1
169+ tzdata==2023.3
170+ ubuntu-advantage-tools==8001
171+ ubuntu-drivers-common==0.0.0
172+ ufw==0.36.1
173+ unattended-upgrades==0.1
174+ urllib3==1.26.5
175+ usb-creator==0.3.7
176+ virtualenv==20.13.0+ds
177+ virtualenv-clone==0.3.0
178+ wadllib==1.3.6
179+ wcwidth==0.2.6
180+ xdg==5
181+ xkit==0.0.0
182+ yarl==1.9.2
183+ zipp==1.0.0
You can’t perform that action at this time.
0 commit comments