Git Product home page Git Product logo

example-speech-to-image's Introduction

speech2image

Create realistic AI generated images from human voice

Leveraging open ai whisper and StableDiffusion in a cloud native application powered by Jina

Under the hood the whisper and stable diffusion models are wrapped into Executors that will make them self-contained microservices. Both of the microservices will be chained into a Flow. The Flow expose a gRPC endpoint which accept DocumentArray as input.

This is an example of a multi-modal application that can be built with jina

How to use it ?

  • Install requirements:
pip install -r requirements.txt
pip install -r executors/stablediffusion/requirements.txt
pip install -r executors/whisper/requirements.txt
  • Start the jina Flow ( you need to get a HF token and accept the StableDiffusion terms to get the model weight. Otherwise you should provide it yourself to the Executor )
JINA_MP_START_METHOD=spawn HF_TOKEN=YOUR_HF_TOKEN python flow.py
  • Alternatively you can deploy the Flow on Jcloud. To do so you should edit the flow.yml and put your HF token in it.
pip install jcloud
jc login
jc deploy flow.yml
python ui.py

or if you started the flow in Jcloud you can do

python ui.py --host grpcs://FLOW_ID.wolf.jina.ai
  • Or just talk directly to the backend with the jina Client
from jina import Client
from docarray import Document
client = Client(host='localhost:54322') 
docs = client.post('/', inputs=[Document(uri='audio.wav') for _ in range(1)])
for img in docs[0].matches:
    img.load_uri_to_image_tensor()

docs[0].matches.plot_image_sprites()

example-speech-to-image's People

Contributors

alaeddine-13 avatar alexcg1 avatar npitsillos avatar samsja avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

example-speech-to-image's Issues

Failed to deploy

When I am trying to deploy the 'flow.yml', error message appears as:

Bad response: expecting 201, got 400 from server.
{
"code": 400,
"error": "cannot load Flow config failed to unmarshal flow config: error unmarshaling JSON: while
decoding JSON: json: cannot unmarshal number into Go struct field tmpType.executors of type
string",
"id": "",
"status": {
"phase": "",
"conditions": null,
"version": "",
"protocol": "",
"endpoints": null,
"dashboards": null
},
"ctime": "0001-01-01T00:00:00Z",
"utime": "0001-01-01T00:00:00Z"
}

I've tried to change the 'uses' in the yml, but nothing seemed t work.

Could you please help?

JINA_MP_START_METHOD=spawn HF_TOKEN=YOUR_FH_TOKEN python flow.py

Hi,

I'm using VSCode on Windows and having a few issues getting this running both locally and pushing to cloud.
Lots of errors when trying to run it after the installs.

Was this tutorial done on windows, mac, or linux?

While the video was interesting as insight into your process, practically it's hard to replicate it locally for various reasons, not lease being the need to have 3 GPU's!

I think it would be a great idea, and far more useful, to do a written blog tutorial that oulines the same project from building it directly in the cloud on Jina.ai.

Do you currently have any tutorials like that?

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.