Skip to content

Commit a2bb92f

Browse files
committed
update
1 parent cbb1a0f commit a2bb92f

33 files changed

+109
-36
lines changed

code/Speak/Speak2.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
chrome_options = Options()
99
chrome_options.add_argument('--log-level=3')
10-
chrome_options.headless = True
11-
PathofDriver = Service("Driver/chromedriver")
10+
#chrome_options.headless = True
11+
PathofDriver = Service("/usr/bin/chromedriver")
1212
driver = webdriver.Chrome(service=PathofDriver,options=chrome_options)
1313
driver.maximize_window()
1414

code/speech.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
say() { local IFS=+;/usr/bin/mplayer -ao alsa -really-quiet -noconsolecontrols "http://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&q=$*&tl=en"; }
3+
say $*

src/Face-Recognition/Image_Dataset_Generator.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ def fun(name,path,MAX_NUMBER_OF_IMAGES):
5656
video_capture.release()
5757
cv2.destroyAllWindows()
5858

59-
fun("Ramim","Images/train",8)
60-
fun("Ramim","Images/test",2)
59+
fun("togor hasan","Images/train",8)
60+
fun("togor hasan","Images/test",2)
6161

Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

src/Face-Recognition/facerec_ipcamera_knn.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ def show_prediction_labels_on_image(frame, predictions):
127127

128128

129129
if __name__ == "__main__":
130-
print("Training KNN classifier...")
131-
classifier = train("Images/train", model_save_path="trained_knn_model.clf", n_neighbors=2)
132-
print("Training complete!")
130+
#print("Training KNN classifier...")
131+
#classifier = train("Images/train", model_save_path="trained_knn_model.clf", n_neighbors=2)
132+
#print("Training complete!")
133133
# process one frame in every 30 frames for speed
134134

135135
process_this_frame = 29
16.5 KB
Binary file not shown.

src/conversation.yaml

+17-7
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ Conversation:
2828
- "are you good"
2929
- "whatsapp"
3030
6:
31-
- 'when fab lab was established'
31+
- 'predict fifa'
32+
- "fifa champion"
3233
7:
33-
- 'your height'
34+
- "quanta robotics"
3435
8:
3536
- 'what do you do'
3637
- 'Why were you made'
@@ -183,7 +184,7 @@ Conversation:
183184
40:
184185
- "Who created you"
185186
- "created you"
186-
- "creates you"
187+
- "made you"
187188
- "how you was created"
188189
- "how you was create"
189190
- "your creator"
@@ -192,6 +193,10 @@ Conversation:
192193
- "who created niko"
193194
- "niko was created by"
194195
- "are you"
196+
- "built you"
197+
- "create you"
198+
- "build you"
199+
- "about your team"
195200
41:
196201
- "I love you"
197202
42:
@@ -291,7 +296,11 @@ Conversation:
291296
- "your origin"
292297
65:
293298
- "your birthday"
294-
299+
66:
300+
- "your birthplace"
301+
- "your headquaters"
302+
- "your headoffice"
303+
- "your office"
295304

296305

297306

@@ -315,9 +324,9 @@ Conversation:
315324
- "I am doing well. what about you"
316325
- "i am Feel Perfect in DC office"
317326
6:
318-
- 'In March 2021 fab lab has been established'
327+
- "I wish to see argentina as a champion because I am a huge fan of Lionel messi but according to probability there is a high chance of brazil become the champion"
319328
7:
320-
- 'I am very tall, my height around 6 feet'
329+
- 'Quanta Robotics is a robotics startup. they make robots like me. Their privious robots are robot sheena and robot blueberry. They also take training the school, college students about robotics and programming'
321330
8:
322331
- 'i work in DC office and help people to find the destination in dc office. meet new people and updating my Artificial intelligence'
323332
9:
@@ -447,7 +456,8 @@ Conversation:
447456
65:
448457
- "Todays is my launching day, so 6th december is my birthday"
449458

450-
459+
66:
460+
- "Comilla DC office, Fablab"
451461

452462

453463

src/faceRecognition.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,22 @@
77
appear = []
88

99
def detect(name):
10-
print("deteted mr ", name)
10+
print("detected mr ", name)
1111
if appear.count(name)==0:
1212
print("first time found")
1313
appear.append(name)
14-
if name == "DC" or name=="DC Sir":
15-
cmd = "Hello Honorable DC Kamrul Hasan sir, it's good to see you"
14+
if name == "togor hasan" or name=="togor hasan":
15+
cmd = "Hello Honorable togor hasan sir, the owener of halima group"
1616
say(cmd)
1717
handshake()
18-
sleep(1)
1918
say("it's a honour to have you with us... Have a beautiful day sir")
2019

2120
else:
22-
cmd = "Hello " + name + " sir, how are you, I am happy to see you"
21+
cmd = "Hello " + name + " sir, I am now able to perfectly recognise you..., how are you sir, I am happy to see you"
2322
say(cmd)
24-
# p1 = multiprocessing.Process(target=say, args=(cmd))
25-
# p1.start()
26-
# sleep(2)
27-
# print("doing handshake")
23+
#p1 = multiprocessing.Process(target=say, args=(cmd))
24+
#p1.start()
25+
#sleep(3)
26+
#print("doing handshake")
2827
handshake()
2928

src/main.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
#from mobility import Forward, Backward, Stop, Left, Right, rightCircle, leftCircle
2929

3030
from move import speakingModeOn
31-
from talk import say
32-
from talk import custom_conversation
31+
from talk1 import say
32+
from talk1 import custom_conversation
3333

3434
try:
3535
FileNotFoundError

src/movement/rightHand.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def handshake():
103103
td = 0.1
104104
servoMove(1, 120)
105105
sleep(0.5)
106-
for x in range(120, 150):
106+
for x in range(120, 160):
107107
servoMove(1, x)
108108
sleep(td)
109109
sleep(1)

src/speech.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def a3():
7777

7878
def a4():
7979
say(" I have 29 Degree of Freedoms for arm movement..... I Have a 7 inch display for operating me...... I have two high torque motor for my mobility.")
80-
80+
8181
def a5():
8282
say("I am created by a group of aspired students from Comilla university named quanta robotics make it happen.......I want mention thier name. they are shanjit Mondol from physics department, Jewel Nath from ICT department, Anik chakraborty from ICT department, Tawsif bin parves from ICT department, Mahin Khan from ICT department")
8383

@@ -88,10 +88,12 @@ def a7():
8888
say("I can recognize humans and differentiate individual person..... I can be controlled remotely ..... I can learn through my environment, although i am stilling my learning phase..... I am tring to be a great assistants to the humans")
8989

9090
def a8():
91-
say("I am created with a scientific goal in mind..... Until now It was challenging to create a body of a robot, since it required complex, expensive manufacturing methods..... In just a few days, it is now possible to experiment with different body shapes thanks to 3D printing, which is used to create my body. I am bangladesh first 100% home manufactured 3D printed robot.... As the government of bangladesh as emphasising on 4th Industrial revolation... I can said proudly that, I am the live 4th industrial revolution")
92-
91+
say("I am created with a scientific goal in mind..... Until now It was challenging to create a body of a robot, since it required complex,expensive manufacturing methods.....")
9392
def a9():
94-
say("Lastly but not lately I expressing my thanks towards ADC general Mohammad Shahadat Hossain sir..... ADC in Education and ICT Nazma Asrafee mam, Assistnat Commissioner Nasrin Sultana Nipa mam, ..... Assistant Commissionar Kaniz Fatema Mam, Assistant Commissioner Atis Sarkar Sir... .. all the DC office employees for assisting in my project....... Without their, the project was impossible to finish....... Thank you again all")
93+
say("In just a few days, it is now possible to experiment with different body shapes thanks to 3D printing, which is used to create my body. .... As the government of bangladesh as emphasising on 4th Industrial revolation... I can said proudly that, I am the live 4th industrial revolution")
94+
95+
def a10():
96+
say("I am bangladesh first 100% home manufactured 3D printed robot. Thank you all")
9597

9698

9799

src/talk.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
from selenium.webdriver.support.ui import Select
2121

2222
chrome_options = webdriver.ChromeOptions()
23-
chrome_options.add_argument('--headless')
23+
#chrome_options.add_argument('--headless')
2424
chrome_options.add_argument('--no-sandbox')
2525
chrome_options.add_argument('--disable-dev-shm-usage')
26-
chrome_options.add_argument('window-size=1920x1480')
26+
#chrome_options.add_argument('window-size=1920x1480')
2727

2828
PathofDriver = Service("/usr/bin/chromedriver")
2929
driver = webdriver.Chrome(service=PathofDriver,options=chrome_options)
30-
driver.maximize_window()
30+
#driver.maximize_window()
3131

3232

3333
Website = "https://ttsmp3.com/"
@@ -51,8 +51,9 @@ def say(Text):
5151
sleep(0.5)
5252

5353
driver.find_element(by=By.XPATH, value='//*[@id="vorlesenbutton"]').click()
54-
54+
5555
print("")
5656
print(f" Robot-Niko Answer : {Text}.")
5757
print("")
58-
58+
sleep( max(2, len(Data)/12) )
59+

src/talk1.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from selenium.webdriver.common.by import By
2121

2222
chrome_options = webdriver.ChromeOptions()
23-
# chrome_options.add_argument('--headless')
23+
chrome_options.add_argument('--headless')
2424
chrome_options.add_argument('--no-sandbox')
2525
chrome_options.add_argument('--disable-dev-shm-usage')
2626
chrome_options.add_argument('window-size=1920x1480')

src/test.py

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
2+
#!/home/pi/robotEnv/bin python
3+
4+
import os
5+
import os.path
6+
import yaml
7+
8+
9+
ROOT_PATH = os.path.realpath(os.path.join(__file__, '..', '..'))
10+
USER_PATH = os.path.realpath(os.path.join(__file__, '..', '..','..'))
11+
12+
with open('{}/src/conversation.yaml'.format(ROOT_PATH),'r', encoding='utf8') as conf:
13+
custom_conversation = yaml.load(conf, Loader=yaml.FullLoader)
14+
15+
from selenium import webdriver
16+
from time import sleep
17+
from selenium.webdriver.chrome.service import Service
18+
from selenium.webdriver.common.by import By
19+
20+
chrome_options = webdriver.ChromeOptions()
21+
chrome_options.add_argument('--headless')
22+
chrome_options.add_argument('--no-sandbox')
23+
chrome_options.add_argument('--disable-dev-shm-usage')
24+
chrome_options.add_argument('window-size=1920x1480')
25+
26+
PathofDriver = Service("/usr/bin/chromedriver")
27+
driver = webdriver.Chrome(service=PathofDriver,options=chrome_options)
28+
driver.maximize_window()
29+
30+
31+
Website = "https://ttsreader.com/"
32+
driver.get(Website)
33+
34+
sleep(0.5)
35+
driver.find_element(by=By.XPATH, value='//*[@id="select_language"]').click()
36+
driver.find_element(by=By.XPATH, value='//*[@id="select_language"]/option[1]').click()
37+
38+
39+
def say(Text):
40+
try:
41+
driver.find_element(by=By.XPATH, value='//*[@id="clearBtn"]').click()
42+
sleep(0.5)
43+
44+
except:
45+
pass
46+
47+
Data = str(Text)
48+
xpathtec = '//*[@id="text_box"]'
49+
driver.find_element(by=By.XPATH, value=xpathtec).click()
50+
driver.find_element(by=By.XPATH, value=xpathtec).send_keys(Data)
51+
sleep(0.5)
52+
driver.find_element(by=By.XPATH, value='//*[@id="play_button"]').click()
53+
54+
print("")
55+
print(f" Robot-Niko Answer : {Text}.")
56+
print("")
57+
58+
say("Hello, how are you")

0 commit comments

Comments
 (0)