Giter Club home page Giter Club logo

image2speech's Introduction

logo

Description

image2speech is an Ethereum ready dapp that combines the functionalities of two other dapps: image2text and text2speech. It applies google's tesseract-OCR engine to extract text from images and uses mimic tts engine to convert text to speech and save them in wav format.

Usage

Bring your images together in a folder (exp: DATADIR) and add an input-config.yml file in the same folder. This file contains configuration for each image it should respect the following format:

<imagename 1>:
    language: <lang>
    voice: <voice name>
    latency: <value>

<imagename 2>:
    language: <lang>
    voice: <voice name>
    latency: <value>

You can keep the language's section empty but this may affect the performance of the extraction process. If voice name and latency are not defined the app will default to "ap" voice and 1.0 latency.

screenshot

In the app/app-config.yml file, change the datadir parameter to the path of your folder (DATADIR for our example) and run the script.

$ git clone https://github.com/Zied-Guesmi/image2speech.git && cd image2speech/
$ sed -i "s/\/iexec/<path/to/datadir/folder>/" app/app-config.yml
$ python3 app/src/app.py

You shoud find your text/sound files in the DATADIR/out/ folder.

screenshot

Supported languages

English (for now).

Supported image types

Tested extensions: jpeg, bmp, png
Those extensions are accepted but were not tested yet: pbm, pgm, ppm, tiff, rast, xbm

Voices

Male: ap, awb_time, awb, kal, kal16, rms.
Female: slt_hts, slt.
See voice samples here.

Dependencies

Docker deployment

After installing docker and preparing your DATADIR folder, just grab the docker image from dockerhub and run it:

$ docker run -v abs/path/to/datadir:/iexec/ ziedguesmi/image2speech

Or you can build your own image from dockerfile:

# clone the dapp
$ git clone https://github.com/Zied-Guesmi/image2speech.git && cd image2speech/ 

# build the docker image
$ docker build -t image2speech .

# run the container
$ docker run -v abs/path/to/datadir:/iexec/ image2speech

Installation

Install system dependencies:

# ubuntu as an example
$ apt-get update && apt-get install -y \
    automake \
    gcc \
    git \
    libasound2-dev \
    libsm6 \
    libtesseract-dev \
    libtool \
    make \
    pkg-config \
    python3 \
    python3-pip \
    tesseract-ocr \
    tesseract-ocr-ara \
    tesseract-ocr-eng \
    tesseract-ocr-fra \
    tesseract-ocr-spa \
    tesseract-ocr-deu \
    tesseract-ocr-chi-sim \
    tesseract-ocr-ita \
    tesseract-ocr-jpn \
    tesseract-ocr-por \
    tesseract-ocr-rus \
    tesseract-ocr-tur \
    tesseract-ocr-kor \
    unzip \
    wget

Install mimic tts engine

$ git clone https://github.com/MycroftAI/mimic.git && cd mimic
$ ./dependencies.sh --prefix="/usr/local"
$ ./autogen.sh
$ ./configure --prefix="/usr/local"
$ make

Clone the app:

$ git clone https://github.com/Zied-Guesmi/image2speech.git && cd image2speech/

Install python depedencies:

$ pip3 install -r app/requirements.txt

TODO

  • Support more languages.
  • Add more mimic voices.
  • Reduce mimic docker image size.

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

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.