David Attenborough narrates your life
Go to file
Ray Smets e074efb942 [REAME] updated with photo booth mode information. 2023-11-24 09:14:36 -08:00
assets first commit 2023-11-07 10:27:35 -05:00
frames commit empty frames folder to save pictures 2023-11-15 22:44:40 +00:00
.gitignore [PhotoBooth] mode (#4) 2023-11-24 09:07:14 -08:00
README.md [REAME] updated with photo booth mode information. 2023-11-24 09:14:36 -08:00
capture.py [PhotoBooth] mode (#4) 2023-11-24 09:07:14 -08:00
narrator.py [PhotoBooth] mode (#4) 2023-11-24 09:07:14 -08:00
requirements.txt [PhotoBooth] mode (#4) 2023-11-24 09:07:14 -08:00
setup.sh [Narrator] streaming (#3) 2023-11-23 15:06:17 -08:00

README.md

David Attenborough narrates your life.

https://twitter.com/charliebholtz/status/1724815159590293764

Want to make your own AI app?

Check out Replicate. We make it easy to run machine learning models with an API.

Setup

Clone this repo, and setup and activate a virtualenv:

python3 -m pip install virtualenv
python3 -m virtualenv venv
source venv/bin/activate

Then, install the dependencies: pip install -r requirements.txt

Make a Replicate, OpenAI, and ElevenLabs account and set your tokens:

export OPENAI_API_KEY=<token>
export ELEVENLABS_API_KEY=<eleven-token>

Make a new voice in Eleven and get the voice id of that voice using their get voices API, or by clicking the flask icon next to the voice in the VoiceLab tab.

export ELEVENLABS_VOICE_ID=<voice-id>

Script

Alternative to running the commands above individually, one can use the setup.sh script to facilitate getting the two required shell envs ready to rock by updating the environment variable values in setup.sh and executing the script.

Note: may have to manually run source source venv/bin/activate afterwards depending on shell env.

Run it!

In on terminal, run the webcam capture:

python capture.py

In another terminal, run the narrator:

python narrator.py

Options

Streaming

If you would like the speech to start quicker via a streaming manner set the environment variable to enable. The concession is that the audio snippet is not saved in the /narration directory.

export ELEVENLABS_STREAMING=true

PhotoBooth

The default behavior of this app will continually analyze images. If you would like to use in a mode more similar to a photo booth, set the environment variable. In this mode, the image will only be analyzed when the spacebar key is pressed.

export PHOTOBOOTH_MODE=true