Skip to main content

Kenzy.Ai: A synthetic human written in Python

Project description

KENZY.Ai · GitHub license Python Versions Read the Docs GitHub release (latest by date)

This project is dedicated to building a “Synthetic Human” which is called Kenzy for which we have assigned the female gender pronoun of “she”. She has visual face recognition (opencv/opencv), speech transcription (coqui), and speech synthesis (festival or mimic3). Kenzy is written in Python and is targeted primarily at the single board computer (SBC) platforms like the Raspberry Pi.

Visit our main site: https://kenzy.ai/

Read the docs: https://docs.kenzy.ai/

Kenzy’s Architecture

Kenzy’s architecture is divided into two main components: Containers and Devices. The containers focus on communication between other containers and devices are designed to control input and output operations. The most important container is the Brain which is a special type of container as it collects data and provides the skill engine for reacting to inputs. While a Brain does support all the methods of a normal container it is recommended to create a separate container to store all your devices.

All options, configurations, and startup parameters are driven by the configuration file saved to the following location:

__Python Module Overview__

| Class/Object                      | Description                      | TCP Port |
| :-------------------------------- | :------------------------------- | :------: |
| kenzy.containers.Brain            | Main service for processing I/O. | 8080     |
| kenzy.containers.DeviceContainer  | Secondary service for devices.   | 8081     |

__Python Device Module Overview__

| Class/Object              | Description                                                 |
| :------------------------ | :---------------------------------------------------------- |
| kenzy.devices.Speaker     | Audio output device for text-to-speech conversion           |
| kenzy.devices.Listener    | Microphone device for speech-to-text conversion             |
| kenzy.devices.Watcher     | Video/Camera device for object recognition                  |
| kenzy.devices.KasaDevice  | Smart plug device for Kasa devices                          |
| kenzy.panels.RaspiPanel   | Panel device designed for Raspberry Pi 7" screen @ 1024x600 |

## Installation

Kenzy is available through pip, but to use the built-in devices there are a few extra libraries you may require.  Please visit the [Basic Install](https://docs.kenzy.ai/en/latest/installation.basic/) page for more details.

Install PIP (Python package manager) if not already installed

sudo apt-get -y install python3-pip

Install the required system packages

sudo apt-get -y install
python3-fann2
python3-pyaudio
python3-pyqt5
python3-dev
libespeak-ng1
festival
festvox-us-slt-hts
libportaudio2
portaudio19-dev
libasound2-dev
libatlas-base-dev
cmake
swig

Create your local environment and then activate it

python3 -m venv /path/to/virtual/env –system-site-packages source /path/to/virtual/env/bin/activate

Install the required build libraries

python3 -m pip install scikit-build

Install core required runtime libraries

python3 -m pip install urllib3
requests
netifaces
padatious
traceback

Install libraries for SpeakerDevice (Required only if using mimic3 in place of festival)

python3 -m pip install mycroft-mimic3-tts[all]

Install optional libraries for WatcherDevice

python3 -m pip install opencv-contrib-python
Pillow

Install optional libraries for KasaDevice

python3 -m pip install asyncio
python-kasa

Install optional libraries for ListenerDevice

python3 -m pip install –upgrade numpy
pyaudio
webrtcvad
stt

python3 -m pip install coqui-stt-module-manager # (For model management, not required)

Install the kenzy module

python3 -m pip install kenzy

To start execute as follows:

python3 -m kenzy

You can disable one or more of the built-in devices or containers with ```--disable-builtin-[speaker, watcher, listener, panels, brain, container]```.  Use the ```--help``` option for full listing of command line options including specifying a custom configuration file.

__NOTE:__ The program will create/save a version of the configuration to ```~/.kenzy/config.json``` along with any other data elements it requires for operation.  The configuration file is fairly powerful and will allow you to add/remove devices and containers for custom configurations including 3rd party devices or custom skills.


## Troubleshooting: "Cannot find FANN libs"
If you encounter an error trying to install the kenzy module on the Raspberry Pi then you may need to add a symlink to the library FANN library. This is due to a bug/miss in the "find_fann" function within the Python FANN2 library as it doesn't look for the ARM architecture out-of-the-box.  To fix it run the following:

### Raspberry Pi (ARM)

sudo ln -s /usr/lib/arm-linux-gnueabihf/libdoublefann.so.2 /usr/local/lib/libdoublefann.so

### Ubuntu 22.04 LTS (x86_64)

sudo ln -s /usr/lib/x86_64-linux-gnu/libdoublefann.so.2 /usr/local/lib/libdoublefann.so

## Enabling Speech-to-Text

In order to enable Speech-to-Text (STT) you need to download a speech model.  You can use Coqui's model manager or use Kenzy to download one for you.  The easiest solution is likely the following command:

python3 -m kenzy –download-models ```

Web Control Panel

If everything is working properly you should be able to point your device to the web control panel running on the Brain engine to test it out. The default URL is:

»http://localhost:8080/


Help & Support

Help and additional details is available at https://kenzy.ai

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kenzy-0.9.1.tar.gz (97.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kenzy-0.9.1-py3-none-any.whl (102.3 kB view details)

Uploaded Python 3

File details

Details for the file kenzy-0.9.1.tar.gz.

File metadata

  • Download URL: kenzy-0.9.1.tar.gz
  • Upload date:
  • Size: 97.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for kenzy-0.9.1.tar.gz
Algorithm Hash digest
SHA256 e26f9a0c792f7dcbc1aee2bcccebed416e1b842a490a8564633ecbbb51714daa
MD5 75663edba3fa0c0b2ed7c7fabf0d5af1
BLAKE2b-256 1bd01b5a0988e470e87e9f6eb214837bfc81c04ae618990cc953b06bfded068c

See more details on using hashes here.

File details

Details for the file kenzy-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: kenzy-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 102.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for kenzy-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 18876880105202d17845fec73e0d11946d1478c1fe31744a5a6346ad263d9ded
MD5 b8b99158f6672c45072d0cd7764481a4
BLAKE2b-256 c610d3b31a3c9d5b41226a82647bd332e91d52bcdb46bc9ac5d5d5c7b868f369

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page