This file contains hidden or 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
from flask import Flask,render_template,request | |
import pickle | |
###Loading model and cv | |
cv = pickle.load(open('cv.pkl','rb')) ##loading cv | |
model = pickle.load(open('spam.pkl','rb')) ##loading model | |
app = Flask(__name__) ## defining flask name | |
@app.route('/') ## home route |
This file contains hidden or 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
for index, item in df.iterrows(): | |
#print(index,item['birthday']) | |
bday = item['Birthday'].strftime("%d-%m") ##wishing time from excel file | |
#print(type(bday)) | |
if(bday == today) and yearnow not in str(item["Year"]): ## birthday data == today date and birthday year is not equal to current year | |
sendEmail(item['Email'] ,"Happy BIrthday "+item["Name"], item['message']) ## pass arguments to the send email funciton and call it | |
update.append(index) ## update the index by one ## we need to check the whole records | |
for i in update: | |
yr = df.loc[i, 'Year'] ## update the year by one | |
#print(yr) |
This file contains hidden or 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
from bs4 import BeautifulSoup | |
import re | |
import requests | |
import heapq | |
from nltk.tokenize import sent_tokenize,word_tokenize | |
from nltk.corpus import stopwords | |
url = str(input("Paste the url"\n")) | |
num = int(input("Enter the Number of Sentence you want in the summary")) | |
num = int(num) |
This file contains hidden or 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
# A single node of a singly linked list | |
class Node: | |
# constructor | |
def __init__(self, data = None, next=None): | |
self.data = data | |
self.next = next | |
# A Linked List class with a single head node | |
class LinkedList: | |
def __init__(self): |
This file contains hidden or 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 face_recognition | |
import cv2 | |
import os | |
from google.colab.patches import cv2_imshow | |
def read_img(path): | |
img = cv2.imread(path) | |
(h,w) = img.shape[:2] | |
width = 500 | |
ratio = width / float(w) | |
height = int(h * ratio) |
This file contains hidden or 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
from flask import Flask,render_template,request | |
import pickle | |
import re | |
import nltk | |
nltk.download('stopwords') | |
from nltk.corpus import stopwords | |
from nltk.stem.porter import PorterStemmer | |
import pickle | |
###Loading model and cv |
This file contains hidden or 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 | |
img = cv2.imread("images/test.jpg") | |
imgCropped = img[50:283,25:190] | |
shape = imgCropped.shape | |
print(shape[0]) | |
imgCropped = cv2.resize(imgCropped,(shape[0]*12//10,shape[1]*2)) | |
cv2.imshow("Image cropped",imgCropped) | |
cv2.imshow("Image",img) | |
cv2.waitKey(0) |
This file contains hidden or 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
FONT_HERSHEY_SIMPLEX normal size sans-serif font | |
FONT_HERSHEY_PLAIN small size sans-serif font | |
FONT_HERSHEY_DUPLEX normal size sans-serif font (more complex than FONT_HERSHEY_SIMPLEX) | |
FONT_HERSHEY_COMPLEX normal size serif font | |
FONT_HERSHEY_TRIPLEX normal size serif font (more complex than FONT_HERSHEY_COMPLEX) | |
FONT_HERSHEY_COMPLEX_SMALL smaller version of FONT_HERSHEY_COMPLEX | |
FONT_HERSHEY_SCRIPT_SIMPLEX hand-writing style font | |
FONT_HERSHEY_SCRIPT_COMPLEX more complex variant of FONT_HERSHEY_SCRIPT_SIMPLEX | |
FONT_ITALIC flag for italic font |
This file contains hidden or 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 numpy as np | |
img = cv2.imread("images/img0.jpg") | |
cv2.line(img,(110,260),(300,260),(0,255,0),3) | |
cv2.rectangle(img,(300,280),(100,20),(0,0,255),2) | |
cv2.circle(img,(200,130),90,(255,255,0),2) | |
cv2.putText(img,"MONALISA",(120,250),cv2.FONT_HERSHEY_COMPLEX,1,(255,255,255),2) | |
cv2.imshow("Image",img) | |
cv2.waitKey(0) |
This file contains hidden or 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
from keras.preprocessing.image import ImageDataGenerator, array_to_img, img_to_array, load_img | |
datagen = ImageDataGenerator( | |
rotation_range=40, | |
width_shift_range=0.2, | |
height_shift_range=0.2, | |
rescale=1./255, | |
shear_range=0.2, | |
zoom_range=0.4, | |
horizontal_flip=True, |