-
Notifications
You must be signed in to change notification settings - Fork 0
/
aws+cloud.py
67 lines (50 loc) · 1.38 KB
/
aws+cloud.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import boto3
import cv2
myec2 = boto3.resource("ec2")
def launchOS():
response = myec2.create_instances(
ImageId = "ami-0da59f1af71ea4ad2",
InstanceType = "t2.micro",
MaxCount = 1,
MinCount = 1
)
import boto3
myec2 = boto3.resource("ec2" )
def launchOS():
response = myec2.create_instances(
ImageId="ami-0da59f1af71ea4ad2",
InstanceType="t2.micro",
MaxCount=1,
MinCount=1
)
import cv2
cap = cv2.VideoCapture( 0 )
from cvzone.HandTrackingModule import HandDetector
detector = HandDetector()
while True:
status , photo = cap.read()
cv2.imshow("my photo",photo)
if cv2.waitKey(20) == 13:
break
handphoto = detector.findHands(photo , draw=False)
if handphoto:
lmlist = handphoto[0]
fingerstatus = detector.fingersUp(lmlist)
if fingerstatus == [1,1,1,1,1]:
print("all up")
launchOS()
launchOS()
launchOS()
launchOS()
launchOS()
elif fingerstatus == [ 0 ,1 ,0 , 0, 0]:
print("index finger up")
launchOS()
elif fingerstatus == [ 0 , 1, 1, 0 , 0 ]:
print("index and middle finger up")
launchOS()
launchOS()
else:
print("idk")
cv2.destroyAllWindows()
cap.release()