Commit ae8c659d authored by Matt Clarkson's avatar Matt Clarkson

Merge branch '3-update-readme'

parents b848fa1b b6c45f9d
Pipeline #2952 passed with stages
in 11 minutes and 48 seconds
......@@ -15,26 +15,36 @@ scikit-surgeryspeech
:alt: Test coverage
.. image::
:alt: Documentation Status
Author: Matt Clarkson
Author: Kim-Celine Kahl
scikit-surgeryspeech is part of the `SNAPPY`_ software project, developed at the `Wellcome EPSRC Centre for Interventional and Surgical Sciences`_, part of `University College London (UCL)`_.
scikit-surgeryspeech supports Python 2.7 and Python 3.6.
scikit-surgeryspeech supports Python 3.6.
scikit-surgeryspeech is a project which runs the `Python Speech Recognition API`_ in the background listening
for a specific command (For now "start "). After saying the keyword you can say different commands, which get
converted to QT Signals.
The speech recognition is done by the `Google Cloud API`_, you have to get the credentials to use it or change the recognition service.
Please explore the project structure, and implement your own functionality.
Example usage
scikit-surgeryspeech is currently a demo project, which will add/multiply two numbers. Example usage:
To run an example, just start
python 5 8
python 3 6 --multiply
Please explore the project structure, and implement your own functionality.
Make sure Google Cloud API is set up correctly as described in the section below.
You can then say "start" as keyword and afterwards a command. The command "quit" exits the application.
Note: each time you have already entered a command, you need to say "start" again to trigger the listening to commands.
......@@ -54,24 +64,53 @@ If you have problems running the application, you might need to install portaudi
brew install portaudio
Running tests
Pytest is used for running unit tests:
Use the Google Cloud speech recognition service
.. _`Google Cloud API is set up correctly`:
To use the Google Cloud speech recognition service, you need to `get the credentials`_ first. After signing up, you
should get a json file with your credentials. Download this file and set the environment variable
pip install pytest
python -m pytest
To the path of your json file. You should then be able to run the application.
Change speech recognition service
This code conforms to the PEP8 standard. Pylint can be used to analyse the code:
To change the speech recognition service if you don't want to use the Google Cloud API, just change the command
pip install pylint
pylint --rcfile=tests/pylintrc sksurgeryspeech
words = recognizer.recognize_google_cloud(audio, credentials_json=self.credentials)
(file "", methods "callback(self, recognizer, audio)", "listen_to_command(self)")
to the recognition service of your choice. Currently available services are:
recognizer.recognize_google_cloud(audio, credentials_json=GOOGLE_CLOUD_SPEECH_CREDENTIALS)
recognizer.recognize_wit(audio, key=WIT_AI_KEY)
recognizer.recognize_bing(audio, key=BING_KEY)
recognizer.recognize_azure(audio, key=AZURE_SPEECH_KEY)
recognizer.recognize_houndify(audio, client_id=HOUNDIFY_CLIENT_ID, client_key=HOUNDIFY_CLIENT_KEY)
recognizer.recognize_ibm(audio, username=IBM_USERNAME, password=IBM_PASSWORD)
Python development
This project uses tox. Start with a clean python environment, then do:
pip install tox
and the commands that are run can be found in tox.ini.
......@@ -95,7 +134,6 @@ Useful links
* `Source code repository`_
* `Documentation`_
Licensing and copyright
......@@ -113,11 +151,12 @@ Supported by `Wellcome`_ and `EPSRC`_.
.. _`Wellcome EPSRC Centre for Interventional and Surgical Sciences`:
.. _`source code repository`:
.. _`Documentation`:
.. _`SNAPPY`:
.. _`University College London (UCL)`:
.. _`Wellcome`:
.. _`EPSRC`:
.. _`contributing guidelines`:
.. _`license file`:
.. _`Python Speech Recognition API`:
.. _`Google Cloud API`:
.. _`get the credentials`:
......@@ -6,7 +6,7 @@ Demo for the Speech API module
import sys
import logging
import PySide2.QtCore
from sksurgeryspeech.algorithms import first_test_speech_api as speech_api
from sksurgeryspeech.algorithms import voice_recognition_service as speech_api
LOGGER = logging.getLogger("voice_recognition_logger")
......@@ -3,7 +3,6 @@
"""scikit-surgeryspeech tests"""
# Pytest style
from sksurgeryspeech.algorithms import first_test_speech_api as speech_api
def test_function_example():
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment