This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Creating Own Face Cropper to Generate Data Set. | |
import cv2,os | |
import numpy as np | |
# Load HAAR face classifier | |
face_classifier = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') | |
# Load functions | |
def face_extractor(img): | |
# Function detects faces and returns the cropped face |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Training the Model | |
cap.release() | |
import cv2 | |
import numpy as np | |
from os import listdir | |
from os.path import isfile, join | |
# Get the training data we previously made | |
data_path = './faces/user/' | |
onlyfiles = [f for f in listdir(data_path) if isfile(join(data_path, f))] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Creating a Function For Sending Email With Attachment! | |
############################################################################################################# | |
import email, smtplib, ssl | |
from getpass import getpass | |
from email import encoders | |
from email.mime.base import MIMEBase | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
import cv2 | |
import numpy as np |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Detecting FACE Infront and Sending EMAIL + WHATSAPP Message | |
################################################################################################################################### | |
## Using Facial Recognition..For Sending Mail!! | |
face_classifier = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') | |
def face_detector(img, size=0.5): | |
# Convert image to grayscale | |
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) | |
faces = face_classifier.detectMultiScale(gray, 1.3, 5) | |
if faces is (): | |
return img, [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#EC2 Instance and Attaching a 5gb EBS Volume.. | |
################################################################################################# | |
import boto3 | |
import subprocess as sb | |
ec2 = boto3.resource('ec2') | |
# Connecting to AWS..We have to configure our AWS CLI first!!! | |
def EC2_launch(): | |
try: | |
#LAunching an Ec2 Instance.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> | |
<style> | |
@import url('https://fonts.googleapis.com/css?family=Ubuntu'); | |
@import url('https://fonts.googleapis.com/css?family=Ubuntu+Mono'); | |
body { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import cgi | |
import subprocess | |
import time | |
print("content-type: text/html") | |
print() | |
k = cgi.FieldStorage() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<title>k8s</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> | |
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lobster&effect=shadow-multiple"> | |
<style> | |
.w3-sofia { | |
font-family: "Lobster", Sans-serif; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import imutils | |
import numpy as np | |
import pytesseract | |
import re | |
import string | |
pytesseract.pytesseract.tesseract_cmd = r'<paste your pytesseract application loacation here>' | |
img = cv2.imread('photo.jpeg',cv2.IMREAD_COLOR) | |
img = cv2.resize(img, (500,600) ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vehicle_reg_no = UP00XX0000 #NumberPlate deteted | |
username = <Enter your siteID> #API_user name | |
url = "http://www.regcheck.org.uk/api/reg.asmx/CheckIndia?RegistrationNumber=" + vehicle_reg_no + "&username="+username | |
url=url.replace(" ","%20") | |
r = requests.get(url) | |
n = xmltodict.parse(r.content) | |
k = json.dumps(n) | |
df = json.loads(k) | |
l=df["Vehicle"]["vehicleJson"] | |
p=json.loads(l) |
OlderNewer