mirror of
https://github.com/wassname/pyrobolearn.git
synced 2026-09-09 11:31:38 +08:00
update interfaces and add interface examples (speech, openpose, asus xtion)
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env python
|
||||
"""Run the speech interface.
|
||||
|
||||
This will perform speech recognition, translation, and synthesization. Make sure that your computer has a microphone
|
||||
connected.
|
||||
|
||||
In the future, interfaces using the Google assistant, Alexa, or a similar tool will be implemented.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
|
||||
from pyrobolearn.tools.interfaces.audio.speech import SpeechRecognizerInterface, SpeechTranslatorInterface
|
||||
|
||||
|
||||
# get the available languages.
|
||||
languages = SpeechRecognizerInterface.available_languages
|
||||
print("Available languages are: {}".format(languages))
|
||||
|
||||
# create parser
|
||||
parser = argparse.ArgumentParser()
|
||||
# parser.add_argument('-t', '--use_thread', help='If we should run the webcam interface in a thread.', type=bool,
|
||||
# default=False)
|
||||
parser.add_argument('-l', '--lang', help='The language that needs to be recognized.', type=str, choices=languages,
|
||||
default='english')
|
||||
parser.add_argument('-a', '--target_lang', help='If we should get depth images.', type=str, choices=languages,
|
||||
default='english')
|
||||
args = parser.parse_args()
|
||||
|
||||
|
||||
# create speech recognizer/translator interface
|
||||
# interface = SpeechRecognizerInterface(verbose=True, lang=args.lang)
|
||||
interface = SpeechTranslatorInterface(verbose=True, from_lang=args.lang, target_lang=args.target_lang)
|
||||
|
||||
# run the interface
|
||||
while True:
|
||||
data = interface.run()
|
||||
Reference in New Issue
Block a user