From bea4f19f1f36a4bf010dacadc10b16c509097e0f Mon Sep 17 00:00:00 2001 From: Biswakalyan Bhuyan Date: Sun, 8 May 2022 18:01:56 +0530 Subject: Artificial Intelligence --- DataBase/ChatBot/ChatBot.py | 81 ++++++++++++++++++++++++ DataBase/ExtraPro/Alarm.py | 37 +++++++++++ DataBase/ExtraPro/Test.py | 8 +++ DataBase/ExtraPro/start.py | 29 +++++++++ DataBase/Gui Materials/speedTest.gif | Bin 0 -> 95104 bytes DataBase/Gui Programs/SpeedTestGui.py | 75 ++++++++++++++++++++++ DataBase/Gui Programs/SpeedTestUi.py | 34 ++++++++++ DataBase/HomeAuto/SmartBulb.py | 94 ++++++++++++++++++++++++++++ DataBase/NasaDataBase/2019-09-27.jpg | Bin 0 -> 1035317 bytes DataBase/NasaDataBase/2021-01-01.jpg | Bin 0 -> 967677 bytes DataBase/NasaDataBase/Images Used/1.png | Bin 0 -> 525734 bytes DataBase/NasaDataBase/Images Used/2.jpg | Bin 0 -> 34110 bytes DataBase/NasaDataBase/Images Used/3.jpg | Bin 0 -> 39427 bytes DataBase/NasaDataBase/Images Used/4.jpg | Bin 0 -> 93542 bytes DataBase/NasaDataBase/Images Used/5.jpg | Bin 0 -> 371542 bytes DataBase/NasaDataBase/Solar Bodies/Data.txt | 34 ++++++++++ DataBase/NotePad/14-30-note.txt | 1 + DataBase/NotePad/14-33-note.txt | 1 + DataBase/OnlineClasses/Links.py | 31 +++++++++ DataBase/Sounds/1.mp3 | Bin 0 -> 68473 bytes DataBase/TimeTable/TimeTable.py | 88 ++++++++++++++++++++++++++ DataBase/Voices/11-25-note.txt | 1 + DataBase/webdriver/chromedriver.exe | Bin 0 -> 11310592 bytes 23 files changed, 514 insertions(+) create mode 100644 DataBase/ChatBot/ChatBot.py create mode 100644 DataBase/ExtraPro/Alarm.py create mode 100644 DataBase/ExtraPro/Test.py create mode 100644 DataBase/ExtraPro/start.py create mode 100644 DataBase/Gui Materials/speedTest.gif create mode 100644 DataBase/Gui Programs/SpeedTestGui.py create mode 100644 DataBase/Gui Programs/SpeedTestUi.py create mode 100644 DataBase/HomeAuto/SmartBulb.py create mode 100644 DataBase/NasaDataBase/2019-09-27.jpg create mode 100644 DataBase/NasaDataBase/2021-01-01.jpg create mode 100644 DataBase/NasaDataBase/Images Used/1.png create mode 100644 DataBase/NasaDataBase/Images Used/2.jpg create mode 100644 DataBase/NasaDataBase/Images Used/3.jpg create mode 100644 DataBase/NasaDataBase/Images Used/4.jpg create mode 100644 DataBase/NasaDataBase/Images Used/5.jpg create mode 100644 DataBase/NasaDataBase/Solar Bodies/Data.txt create mode 100644 DataBase/NotePad/14-30-note.txt create mode 100644 DataBase/NotePad/14-33-note.txt create mode 100644 DataBase/OnlineClasses/Links.py create mode 100644 DataBase/Sounds/1.mp3 create mode 100644 DataBase/TimeTable/TimeTable.py create mode 100644 DataBase/Voices/11-25-note.txt create mode 100644 DataBase/webdriver/chromedriver.exe (limited to 'DataBase') diff --git a/DataBase/ChatBot/ChatBot.py b/DataBase/ChatBot/ChatBot.py new file mode 100644 index 0000000..99215d9 --- /dev/null +++ b/DataBase/ChatBot/ChatBot.py @@ -0,0 +1,81 @@ +import random + +Hello = ('hello','hey','hii','hi') + +reply_Hello = ('Hello Sir , I Am Zara .', + "Hey , What's Up ?", + "Hey How Are You ?", + "Hello Sir , Nice To Meet You Again .", + "Of Course Sir , Hello .") + +Bye = ('bye','exit','sleep','go') + +reply_bye = ('Bye Sir.', + "It's Okay .", + "It Will Be Nice To Meet You .", + "Bye.", + "Thanks.", + "Okay.") + +How_Are_You = ('how are you','are you fine') + +reply_how = ('I Am Fine.', + "Excellent .", + "Moj Ho rhi Hai .", + "Absolutely Fine.", + "I'm Fine.", + "Thanks For Asking.") + +nice = ('nice','good','thanks') + +reply_nice = ('Thanks .', + "Ohh , It's Okay .", + "Thanks To You.") + +Functions = ['functions','abilities','what can you do','features'] + +reply_Functions = ('I Can Perform Many Task Or Varieties Of Tasks , How Can I Help You ?', + 'I Can Call Your G.F .', + 'I Can Message Your Mom That You Are Not Studing..', + 'I Can Tell Your Class Teacher That You Had Attended All The Online Classes On Insta , Facebbook etc!', + 'Let Me Ask You First , How Can I Help You ?', + 'If You Want Me To Tell My Features , Call : Print Features !') + +sorry_reply = ("Sorry , That's Beyond My Abilities .", + "Sorry , I Can't Do That .", + "Sorry , That's Above Me.") + +def ChatterBot(Text): + + Text = str(Text) + + for word in Text.split(): + + if word in Hello: + + reply = random.choice(reply_Hello) + + return reply + + elif word in Bye: + + reply = random.choice(reply_bye) + + return reply + + elif word in How_Are_You: + + reply_ = random.choice(reply_how) + + return reply_ + + elif word in Functions: + + reply___ = random.choice(reply_Functions) + + return reply___ + + else: + + return random.choice(sorry_reply) + diff --git a/DataBase/ExtraPro/Alarm.py b/DataBase/ExtraPro/Alarm.py new file mode 100644 index 0000000..d912df5 --- /dev/null +++ b/DataBase/ExtraPro/Alarm.py @@ -0,0 +1,37 @@ +import os +from playsound import playsound +import datetime + +extracted_time = open('E:\\Zara\\Data.txt','rt') +time = extracted_time.read() +Time = str(time) + +delete_time = open("E:\\Zara\\Data.txt",'r+') +delete_time.truncate(0) +delete_time.close() + +def RingerNow(time): + + time_to_set = str(time) + time_now = time_to_set.replace("zara","") + time_now = time_now.replace("set alarm for ","") + time_now = time_now.replace("set ","") + time_now = time_now.replace("alarm ","") + time_now = time_now.replace("for ","") + time_now = time_now.replace(" and ",":") + + Alarm_Time = str(time_now) + + while True: + + current_time = datetime.datetime.now().strftime("%H:%M") + + if current_time == Alarm_Time: + print("Wake Up Sir , It's Time To Work .") + playsound("E:\\Zara\\DataBase\\Sounds\\1.mp3") + + elif current_time>Alarm_Time: + break + +RingerNow(Time) + diff --git a/DataBase/ExtraPro/Test.py b/DataBase/ExtraPro/Test.py new file mode 100644 index 0000000..d46858d --- /dev/null +++ b/DataBase/ExtraPro/Test.py @@ -0,0 +1,8 @@ +from time import sleep +import pyautogui + +sleep(4) + +kk = pyautogui.position() + +print(kk) diff --git a/DataBase/ExtraPro/start.py b/DataBase/ExtraPro/start.py new file mode 100644 index 0000000..a2dff90 --- /dev/null +++ b/DataBase/ExtraPro/start.py @@ -0,0 +1,29 @@ +import os +from GoogleImageScrapper.GoogleImageScrapper import GoogleImageScraper +import pyautogui + +def GoogleImage(): + oo = open('E:\\Zara\\Data.txt','rt') + query = str(oo.read()) + oo.close() + pppp = open('E:\\Zara\\Data.txt','r+') + pppp.truncate(0) + pppp.close() + + webdriver = "E:\\Zara\\DataBase\\webdriver\\chromedriver.exe" + photos = "E:\\Zara\\DataBase\\GooglePhotos\\" + + search_keys = [f"{query}"] + number = 10 + head = False + max = (1000,1000) + min = (0,0) + + for search_key in search_keys: + image_search = GoogleImageScraper(webdriver,photos,search_keys,number,head,min,max) + image_url = image_search.find_image_urls() + image_search.save_images(image_url) + + os.startfile(photos) + +GoogleImage() diff --git a/DataBase/Gui Materials/speedTest.gif b/DataBase/Gui Materials/speedTest.gif new file mode 100644 index 0000000..cf480e8 Binary files /dev/null and b/DataBase/Gui Materials/speedTest.gif differ diff --git a/DataBase/Gui Programs/SpeedTestGui.py b/DataBase/Gui Programs/SpeedTestGui.py new file mode 100644 index 0000000..0fa2e47 --- /dev/null +++ b/DataBase/Gui Programs/SpeedTestGui.py @@ -0,0 +1,75 @@ +from PyQt5.QtGui import * +from PyQt5.QtWidgets import * +from PyQt5.QtCore import * +from PyQt5 import QtCore , QtWidgets , QtGui +from PyQt5.QtGui import QMovie +from PyQt5.uic import loadUiType +import sys +import pyttsx3 +from SpeedTestUi import Ui_SpeedTest + +engine = pyttsx3.init('sapi5') +voices = engine.getProperty('voices') +engine.setProperty('voices',voices[0].id) + +def Speak(audio): + print(" ") + print(f": {audio}") + engine.say(audio) + engine.runAndWait() + print(" ") + +def run_uit(): + + Speak("I Am Checking Speed Sir , Wait For A While .") + + import speedtest + + speed = speedtest.Speedtest() + + upload = speed.upload() + + correct_Up = int(int(upload)/800000) + + download = speed.download() + + correct_down = int(int(download)/800000) + + Speak(f"Downloading Speed Is {correct_down} M B Per Second .") + Speak(f"Uploading Speed Is {correct_Up} M B Per Second .") + + exit() + +class MainThread(QThread): + + def __init__(self): + + super(MainThread,self).__init__() + + def run(self): + run_uit() + +StartExe = MainThread() + +class StartExecution(QMainWindow): + + def __init__(self): + + super().__init__() + + self.ui = Ui_SpeedTest() + + self.ui.setupUi(self) + + self.ui.label = QMovie("E:\\Zara\\DataBase\\Gui Materials\\speedTest.gif") + + self.ui.gif.setMovie(self.ui.label) + + self.ui.label.start() + + StartExe.start() + +App = QApplication(sys.argv) +speedtest = StartExecution() +speedtest.show() +exit(App.exec_()) diff --git a/DataBase/Gui Programs/SpeedTestUi.py b/DataBase/Gui Programs/SpeedTestUi.py new file mode 100644 index 0000000..cf7d4a7 --- /dev/null +++ b/DataBase/Gui Programs/SpeedTestUi.py @@ -0,0 +1,34 @@ +from PyQt5 import QtCore, QtGui, QtWidgets + +class Ui_SpeedTest(object): + + def setupUi(self, SpeedTest): + + SpeedTest.setObjectName("SpeedTest") + SpeedTest.resize(582, 335) + self.centralwidget = QtWidgets.QWidget(SpeedTest) + self.centralwidget.setObjectName("centralwidget") + self.gif = QtWidgets.QLabel(self.centralwidget) + self.gif.setGeometry(QtCore.QRect(-10, 0, 601, 341)) + self.gif.setText("") + self.gif.setPixmap(QtGui.QPixmap("E:\\Zara\\DataBase\\Gui Materials\\speedTest.gif")) + self.gif.setScaledContents(True) + self.gif.setObjectName("gif") + SpeedTest.setCentralWidget(self.centralwidget) + + self.retranslateUi(SpeedTest) + QtCore.QMetaObject.connectSlotsByName(SpeedTest) + + def retranslateUi(self, SpeedTest): + _translate = QtCore.QCoreApplication.translate + SpeedTest.setWindowTitle(_translate("SpeedTest", "MainWindow")) + +if __name__ == "__main__": + import sys + app = QtWidgets.QApplication(sys.argv) + SpeedTest = QtWidgets.QMainWindow() + ui = Ui_SpeedTest() + ui.setupUi(SpeedTest) + SpeedTest.show() + sys.exit(app.exec_()) + diff --git a/DataBase/HomeAuto/SmartBulb.py b/DataBase/HomeAuto/SmartBulb.py new file mode 100644 index 0000000..8fad54c --- /dev/null +++ b/DataBase/HomeAuto/SmartBulb.py @@ -0,0 +1,94 @@ +from re import S +import pyttsx3 +import speech_recognition as sr +import pyautogui +import os +import keyboard +from time import sleep + +engine = pyttsx3.init('sapi5') +voices = engine.getProperty('voices') +engine.setProperty('voices',voices[1].id) + +def Speak(audio): + print(" ") + print(f": {audio}") + engine.say(audio) + engine.runAndWait() + print(" ") + +def TakeCommand(): + + r = sr.Recognizer() + + with sr.Microphone() as source: + + print(": Listening....") + + r.pause_threshold = 1 + + audio = r.listen(source) + + + try: + + print(": Recognizing...") + + query = r.recognize_google(audio,language='en-in') + + print(f": Your Command : {query}\n") + + except: + return "" + + return query.lower() + +def Activate(): + + try: + + os.system('TASKKILL /F /im HD-Player.exe') + + except Exception as e: + print(e) + + Speak("Activating The Home Automation Setup.") + + keyboard.press_and_release('windows + s') + + sleep(1) + + keyboard.write('blue') + + sleep(1) + + keyboard.press('enter') + + sleep(20) + + pyautogui.click(x=1157, y=81) + + sleep(5) + + pyautogui.click(x=553, y=148) + + sleep(3) + + Speak("Activated The Home Setup .") + +def StartLight(): + + Speak("Activating The Smart Bulb .") + + pyautogui.click(x=820, y=187) + + Speak("Activated.") + +def CloseLight(): + + Speak("Closing The Smart Bulb .") + + pyautogui.click(x=820, y=187) + + Speak("Closed.") + diff --git a/DataBase/NasaDataBase/2019-09-27.jpg b/DataBase/NasaDataBase/2019-09-27.jpg new file mode 100644 index 0000000..5eadd00 Binary files /dev/null and b/DataBase/NasaDataBase/2019-09-27.jpg differ diff --git a/DataBase/NasaDataBase/2021-01-01.jpg b/DataBase/NasaDataBase/2021-01-01.jpg new file mode 100644 index 0000000..e6409ab Binary files /dev/null and b/DataBase/NasaDataBase/2021-01-01.jpg differ diff --git a/DataBase/NasaDataBase/Images Used/1.png b/DataBase/NasaDataBase/Images Used/1.png new file mode 100644 index 0000000..c473e91 Binary files /dev/null and b/DataBase/NasaDataBase/Images Used/1.png differ diff --git a/DataBase/NasaDataBase/Images Used/2.jpg b/DataBase/NasaDataBase/Images Used/2.jpg new file mode 100644 index 0000000..2167a05 Binary files /dev/null and b/DataBase/NasaDataBase/Images Used/2.jpg differ diff --git a/DataBase/NasaDataBase/Images Used/3.jpg b/DataBase/NasaDataBase/Images Used/3.jpg new file mode 100644 index 0000000..6089174 Binary files /dev/null and b/DataBase/NasaDataBase/Images Used/3.jpg differ diff --git a/DataBase/NasaDataBase/Images Used/4.jpg b/DataBase/NasaDataBase/Images Used/4.jpg new file mode 100644 index 0000000..de5d5e5 Binary files /dev/null and b/DataBase/NasaDataBase/Images Used/4.jpg differ diff --git a/DataBase/NasaDataBase/Images Used/5.jpg b/DataBase/NasaDataBase/Images Used/5.jpg new file mode 100644 index 0000000..b60b2c9 Binary files /dev/null and b/DataBase/NasaDataBase/Images Used/5.jpg differ diff --git a/DataBase/NasaDataBase/Solar Bodies/Data.txt b/DataBase/NasaDataBase/Solar Bodies/Data.txt new file mode 100644 index 0000000..d6a1fa8 --- /dev/null +++ b/DataBase/NasaDataBase/Solar Bodies/Data.txt @@ -0,0 +1,34 @@ +lune,phobos,deimos,io,europe,ganymede,callisto,amalthee,himalia, +elara,pasiphae,sinope,lysithea,carme,ananke,leda,thebe, +adrastee,metis,callirrhoe,themisto,megaclite,taygete, +chaldene,harpalyke,kalyke,iocaste,erinome,isonoe,praxidike, +autonoe,thyone,hermippe,aitne,eurydome,euanthe,euporie, +orthosie,sponde,cale,pasithee,hegemone,mneme,aoede,thelxinoe, +arche,callichore,helice,carpo,eukelade,cyllene,core,herse, +s2003j2,eupheme,s2003j4,eirene,s2003j9,s2003j10,s2003j12, +philophrosyne,s2003j16,s2003j18,s2003j19,s2003j23,mimas, +encelade,tethys,dione,rhea,titan,hyperion,japet,phoebe,janus, +epimethee,helene,telesto,calypso,atlas,promethee,pandore, +pan,ymir,paaliaq,tarvos,ijiraq,suttungr,kiviuq,mundilfari, +albiorix,skathi,erriapo,siarnaq,thrymr,narvi,methone,pallene, +pollux,daphnis,aegir,bebhionn,bergelmir,bestla,farbauti, +fenrir,fornjot,hati,hyrrokkin,kari,loge,skoll,surtur,anthe, +jarnsaxa,greip,tarqeq,egeon,s2004s7,s2004s12,s2004s13, +s2004s17,s2006s1,s2006s3,s2007s2,s2007s3,s2009s1,ariel, +umbriel,titania,oberon,miranda,cordelia,ophelia,bianca, +cressida,desdemona,juliet,portia,rosalind,belinda,puck, +caliban,sycorax,prospero,setebos,stephano,trinculo, +francisco,margaret,ferdinand,perdita,mab,cupid,triton, +nereide,naiade,thalassa,despina,galatee,larissa,protee,halimede,psamathee, +sao,laomedie,neso,charon,nix,hydra,namaka,hiiaka,dysnomie, +dia,s2004s3,s2004s4,s2004s6,s2010j1,s2010j2,ceres,hebe,lempo, +prince,pulcova,toutatis,quaoar,steins,eris,astree,pholus,castalia,remus, +hector,kleopatra,cruithne,junon,hygie,lutetia,mathilde,uranus,iris,eros,vanth, +sedna,chariklo,sylvia,dactyl,orcus,pluton,damocles,romulus,alexhelios,cleoselene, +flore,chiron,eureka,achille,weywot,ixion,neptune,sl9,9metis,haumea,nessus,itokawa, +hylonome,eugenia,2006SQ372,pallas,asbolus,varuna,vesta,ida,hyakutake,gaspra,albion, +makemake,halley,jupiter,mars,mercure,saturne,soleil,terre,venus,kerberos +,s2011j1,s2011j2,styx,hippocampe,mk2,s2017j1,s2016j1,valetudo,s2017j2,s2017j3, +pandia,s2017j5,s2017j6,s2017j7,s2017j8,s2017j9,ersa,arrokoth,benou,s2004s22,s2004s21, +s2004s20,s2004s23,s2004s24,s2004s25,s2004s26,s2004s27,s2004s28,s2004s29,s2004s30, +s2004s31,s2004s32,s2004s33,s2004s34,s2004s35,s2004s36,s2004s37,s2004s38,s2004s39,c2020f3-neowise \ No newline at end of file diff --git a/DataBase/NotePad/14-30-note.txt b/DataBase/NotePad/14-30-note.txt new file mode 100644 index 0000000..2334bcc --- /dev/null +++ b/DataBase/NotePad/14-30-note.txt @@ -0,0 +1 @@ +how are you Zara i am fine \ No newline at end of file diff --git a/DataBase/NotePad/14-33-note.txt b/DataBase/NotePad/14-33-note.txt new file mode 100644 index 0000000..5c5d2ee --- /dev/null +++ b/DataBase/NotePad/14-33-note.txt @@ -0,0 +1 @@ +hello Zara how are you Zara main nata \ No newline at end of file diff --git a/DataBase/OnlineClasses/Links.py b/DataBase/OnlineClasses/Links.py new file mode 100644 index 0000000..707a73a --- /dev/null +++ b/DataBase/OnlineClasses/Links.py @@ -0,0 +1,31 @@ + +def Science(): + + Link = "https://meet.google.com/ify-fhhk-zrs" + + return Link + +def Maths(): + + Link = "https://meet.google.com/ify-fhhk-zrs" + + return Link + +def Hindi(): + + Link = "https://meet.google.com/ify-fhhk-zrs" + + return Link + +def English(): + + Link = "https://meet.google.com/ify-fhhk-zrs" + + return Link + +def sst(): + + Link = "https://meet.google.com/ify-fhhk-zrs" + + return Link + diff --git a/DataBase/Sounds/1.mp3 b/DataBase/Sounds/1.mp3 new file mode 100644 index 0000000..61fd9ce Binary files /dev/null and b/DataBase/Sounds/1.mp3 differ diff --git a/DataBase/TimeTable/TimeTable.py b/DataBase/TimeTable/TimeTable.py new file mode 100644 index 0000000..ee1e805 --- /dev/null +++ b/DataBase/TimeTable/TimeTable.py @@ -0,0 +1,88 @@ +from datetime import datetime +import pyttsx3 + +engine = pyttsx3.init('sapi5') +voices = engine.getProperty('voices') +engine.setProperty('voices',voices[2].id) + +def Speak(audio): + print(" ") + print(f": {audio}") + engine.say(audio) + engine.runAndWait() + print(" ") + +FiveTo6 = ''' +In This Time , +You Have To Get Up & Listen Somethintg Positive . +5:00 Am To 6:00 Am +Thanks. +''' + +SixTo9 = ''' +In This Time , +You Have To Study . +6:00 Am To 9:00 Am . +Thanks . +''' + +NineTo12 = ''' +In This Time , +You Have A Make A Video & Have To Upload It On YouTube . +9:00 Am To 12:00 Pm . +Thanks . +''' + +TwelveTo15 = ''' +In This Time , +You Have To Gain Some Knowledge From The Internet OR From Your Books . +12:00 Pm To 3:00 Pm . +Thanks . +''' + +FifteenTo21 = ''' +In This Time , +You Have To Code . +3:00 Pm To 9:00 Pm . +Thanks . +''' + +TwentyOneTo22 = ''' +In This Time , +You Have To Sleep . +9:00 Pm To 10:00 Pm . +Thanks . +''' + +def Time(): + + hour = int(datetime.now().strftime("%H")) + + if hour>=5 and hour<6: + Speak(FiveTo6) + return FiveTo6 + + elif hour>=6 and hour<9: + Speak(SixTo9) + return SixTo9 + + elif hour>=9 and hour<12: + Speak(NineTo12) + return NineTo12 + + elif hour>=12 and hour<15: + Speak(TwelveTo15) + return TwelveTo15 + + elif hour>=15 and hour<21: + Speak(FifteenTo21) + return FifteenTo21 + + elif hour>=21 and hour<22: + Speak(TwentyOneTo22) + return TwentyOneTo22 + + else: + Speak("In This Time , You Have To Sleep ") + + return '''In This Time , You Have To Sleep .''' diff --git a/DataBase/Voices/11-25-note.txt b/DataBase/Voices/11-25-note.txt new file mode 100644 index 0000000..b6fc4c6 --- /dev/null +++ b/DataBase/Voices/11-25-note.txt @@ -0,0 +1 @@ +hello \ No newline at end of file diff --git a/DataBase/webdriver/chromedriver.exe b/DataBase/webdriver/chromedriver.exe new file mode 100644 index 0000000..10036f1 Binary files /dev/null and b/DataBase/webdriver/chromedriver.exe differ -- cgit v1.2.3-59-g8ed1b