Skip to content

Commit 9d32f64

Browse files
Add files via upload
1 parent e7b9a4e commit 9d32f64

10 files changed

Lines changed: 113 additions & 0 deletions

File tree

compare.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import subprocess as s
2+
c="aws rekognition search-faces-by-image \
3+
--image '{\"S3Object\":{\"Bucket\":\"facerek1612\",\"Name\":\"new_image91.jpeg\"}}' \
4+
--collection-id \"images\" \
5+
--region us-east-1 \
6+
--profile adminuser"
7+
s.Popen(c,shell=True,executable='/bin/bash')
8+

creating_collection.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import subprocess as s
2+
c="aws rekognition create-collection \
3+
--collection-id \"images\" \
4+
--region us-east-1 \
5+
--profile adminuser"
6+
s.Popen(c,shell=True,executable='/bin/bash')
7+
8+
9+

delete.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import subprocess as s
2+
c="aws s3 rm s3://facerek1612 --recursive"
3+
s.Popen(c,shell=True,executable='/bin/bash')
4+
5+

extract.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import subprocess as s
2+
c="aws rekognition index-faces \
3+
--image '{\"S3Object\":{\"Bucket\":\"facerek1612\",\"Name\":\"new_image1.jpeg\"}}' \
4+
--collection-id \"images\" \
5+
--region us-east-1 \
6+
--profile adminuser"
7+
s.Popen(c,shell=True,executable='/bin/bash')
8+
9+
10+
c="aws rekognition index-faces \
11+
--image '{\"S3Object\":{\"Bucket\":\"facerek1612\",\"Name\":\"new_image2.jpeg\"}}' \
12+
--collection-id \"images\" \
13+
--region us-east-1 \
14+
--profile adminuser"
15+
s.Popen(c,shell=True,executable='/bin/bash')
16+
17+
c="aws rekognition index-faces \
18+
--image '{\"S3Object\":{\"Bucket\":\"facerek1612\",\"Name\":\"new_image3.jpeg\"}}' \
19+
--collection-id \"images\" \
20+
--region us-east-1 \
21+
--profile adminuser"
22+
s.Popen(c,shell=True,executable='/bin/bash')
23+
24+
c="aws rekognition index-faces \
25+
--image '{\"S3Object\":{\"Bucket\":\"facerek1612\",\"Name\":\"new_image4.jpeg\"}}' \
26+
--collection-id \"images\" \
27+
--region us-east-1 \
28+
--profile adminuser"
29+
s.Popen(c,shell=True,executable='/bin/bash')
30+
31+
32+
33+

final.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import json
2+
with open('output1.json' ,'r') as myfile:
3+
data=myfile.read()
4+
5+
data=json.loads(data)
6+
l=len(data['FaceMatches'])
7+
if l==0:
8+
import mail
9+
else:
10+
print("yes")
11+

mail.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from sparkpost import SparkPost
2+
3+
sp = SparkPost('2a5e51536720e107050b8ec31e7428cea9266ca4')
4+
5+
response = sp.transmissions.send(
6+
use_sandbox=True,
7+
recipients=['prateekkumar1612@gmail.com'],
8+
html='<p>Intruder Alert</p>',
9+
from_email='test@sparkpostbox.com',
10+
subject='Smart System'
11+
)
12+
13+
print(response)

make_bucket.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import subprocess as s
2+
c="aws s3api create-bucket --bucket facerek1612 --region us-east-1"
3+
s.Popen(c,shell=True, executable='/bin/bash')

output1.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"SearchedFaceBoundingBox": {
3+
"Width": 0.3706597089767456,
4+
"Top": 0.2455555498600006,
5+
"Left": 0.36917707324028015,
6+
"Height": 0.2777777910232544
7+
},
8+
"SearchedFaceConfidence": 99.82778930664062,
9+
"FaceMatches": []
10+
}

upload.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import subprocess as s
2+
c="aws s3api put-object --bucket facerek1612 --key new_image1.jpeg --body /home/megatron/AWS/111"
3+
s.Popen(c,shell=True,executable='/bin/bash')
4+
5+
6+
c="aws s3api put-object --bucket facerek1612 --key new_image2.jpeg --body /home/megatron/AWS/211"
7+
s.Popen(c,shell=True,executable='/bin/bash')
8+
9+
10+
c="aws s3api put-object --bucket facerek1612 --key new_image3.jpeg --body /home/megatron/AWS/311"
11+
s.Popen(c,shell=True,executable='/bin/bash')
12+
13+
14+
c="aws s3api put-object --bucket facerek1612 --key new_image4.jpeg --body /home/megatron/AWS/411"
15+
s.Popen(c,shell=True,executable='/bin/bash')
16+

upload1.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import subprocess as s
2+
c="aws s3api put-object --bucket facerek1612 --key new_image91.jpeg --body /home/megatron/AWS/99"
3+
s.Popen(c,shell=True,executable='/bin/bash')
4+
5+

0 commit comments

Comments
 (0)