Skip to content

Commit

Permalink
conflicts resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
hmangukia committed Aug 23, 2018
2 parents 9753a7c + 361f669 commit 5bfa93b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
2 changes: 2 additions & 0 deletions windows/activities.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
List of the things that B.E.N.J.I. can do:

* Authenticate user by using facial recognition with the help of webcam
* Search for lyrics of song
* Add and save notes
* Screen Recorder(Audio+Video)
* Audio Recorder
Expand Down Expand Up @@ -95,6 +96,7 @@ The commands for the various functions are as follows:
* "***Who are you/Identify Youself/What is your name***" for B.E.N.J.I. to introduce itself.
* Face detection feature will automatically fetch image for first time user. From next time, it will predict the authenticity of user. If user is authenticated, then B.E.N.J.I. will start running. If user wants to add another user, he/she can use "***face*** username". By default, username is "admin". So, make sure, while adding a new user, use "username" other than "admin". B.E.N.J.I. will fetch a single image of the user and store it in "dataset" folder in "C" drive.
NOTE: Make sure that system is able to fetch a good image of yours(be in a good lighting conditions). You can also directly add image to "dataset" folder in "C" drive.
* "***lyrics*** _SongName_" gives lyrics of the mentioned song. If required, more details can be provided after the _SongName_ like "***lyrics*** _SongName_ _Album/MovieName_"
* "***note*** _NoteContent_" to add a note. The note is saved on your desktop.
* "***recorder*** _VideoName_ _AudioName_" to initiate screen recorder. If only "***recorder***" is used, it will use "UScreenCapture" and "Microphone (Realtek High Definition Audio)" as default video and audio. You can choose them, by using "ffmpeg -list_devices true -f dshow -i dummy" in command prompt. If only "***recorder*** _VideoName_" is used, then the audio will be chosen as per the default one. NOTE: Press 'q' in the command prompt when you are done with the recording. This holds true for every other recording feature.
* "***audio recorder*** _AudioName_" records audio. Use "***audio recorder***", this will use default audio "Microphone (Realtek High Definition Audio)".
Expand Down
26 changes: 17 additions & 9 deletions windows/benji.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
speak = pyttsx3.init()

def events(frame,put):
identity_keywords = ["who are you", "who r u", "what is your name", "who you are"]
identity_keywords = ["who are you", "who r u", "what is your name"]
youtube_keywords = ("play ", "stream ", "queue ")
launch_keywords = ["open ", "launch "]
search_keywords = ["search "]
Expand Down Expand Up @@ -102,7 +102,7 @@ def events(frame,put):
speak.runAndWait()
except:
print("Error speaking, here is the translated text: {}".format(translated.text))

#Add user for face detection
elif link[0] == "face" or link[0] == "phase":
name = link[1]
Expand All @@ -112,7 +112,17 @@ def events(frame,put):
cv2.imwrite(path + "/" + str(name) + ".jpg", img)
cam.release()
cv2.destroyAllWindows()


#Get lyrics
elif link[0] == "lyrics":
link = '+'.join(link[1:])
link = link.replace('+',' ')
title = link[1:]
goog_search = "https://www.google.com/search?q=" + title + "+lyrics"
r = requests.get(goog_search)
soup = BeautifulSoup(r.text, "html.parser")
webbrowser.open(soup.find('cite').text)

#Get top 10 tweets
elif link[0] == "get" and link[-1] == "tweets":
auth = OAuthHandler(twitterCredentials.consumer_key, twitterCredentials.consumer_secret)
Expand All @@ -127,17 +137,16 @@ def events(frame,put):
print("\n", status.text)
print("By ", status.user.screen_name, " at ", status.user.created_at)


#Get friends from twitter
elif link[-1] == "twitter":
if link[-3] == "follow" and link[-1] == "twitter":
auth = OAuthHandler(twitterCredentials.consumer_key, twitterCredentials.consumer_secret)
auth.set_access_token(twitterCredentials.access_token, twitterCredentials.access_secret)
api = tweepy.API(auth)
for friend in tweepy.Cursor(api.friends).items():
print("\nName: ", json.dumps(friend.name), " Username: ", json.dumps(friend.screen_name))
#Screenshot
print("\nName: ", json.dumps(friend.name), " Username: ", json.dumps(friend.screen_name))
#Screenshot
elif put.startswith('take screenshot') or put.startswith("screenshot"):
try:
pic = pyautogui.screenshot()
Expand Down Expand Up @@ -186,8 +195,7 @@ def events(frame,put):
root.mainloop()
except:
print("Unable to take upcoming events")



#Add note
elif put.startswith("note") or put.startswith("not") or put.startswith("node"):
try:
Expand Down
1 change: 1 addition & 0 deletions windows/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ data==0.4
decorator==4.1.2
dlib=19.14.0
face-recognition==1.2.2
face-recognition-models==0.3.0
funcsigs==1.0.2
future==0.16.0
google-api-python-client
Expand Down

0 comments on commit 5bfa93b

Please sign in to comment.