Skip to content

This repository contains the Web application to convert Image Text To Audio using Google Cloud Platform (GCP) Resources

License

Notifications You must be signed in to change notification settings

akb-7/MAGE-ITTA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MAGE-ITTA

Web application which converts the text found in the image to audio using GCP

output_img

The steps followed are here:

Open in Cloud Shell

This sample demonstrates how to use the Google Cloud Vision API, Google Cloud Storage, Google TextToSpeech and Google Cloud Datastore on Google App Engine Flexible Environment.

Setup

Create a new project with the Google Cloud Platform console. Make a note of your project ID, which may be different than your project name.

Make sure to Enable Billing for your project.

Download the Google Cloud SDK to your local machine. Alternatively, you could use the Cloud Shell, which comes with the Google Cloud SDK pre-installed.

Initialize the Google Cloud SDK (skip if using Cloud Shell):

gcloud init

Create your App Engine application:

gcloud app create

Set an environment variable for your project ID, replacing [YOUR_PROJECT_ID] with your project ID:

export PROJECT_ID=[YOUR_PROJECT_ID]

Getting the sample code

Run the following command to clone the Github repository:

git clone https://github.com/aakash-cse/MAGE-ITTA.git

Change directory to the sample code location:

cd MAGE-ITTA

Authentication

Enable the APIs:

gcloud services enable vision.googleapis.com
gcloud services enable storage-component.googleapis.com
gcloud services enable datastore.googleapis.com
gcloud services enable texttospeech.googleapis.com

Create a Service Account to access the Google Cloud APIs when testing locally:

gcloud iam service-accounts create hackathon \
--display-name "My Project Service Account"

Give your newly created Service Account appropriate permissions:

gcloud projects add-iam-policy-binding ${PROJECT_ID} \
--member serviceAccount:hackathon@${PROJECT_ID}.iam.gserviceaccount.com \
--role roles/owner

After creating your Service Account, create a Service Account key:

gcloud iam service-accounts keys create ~/key.json --iam-account \
hackathon@${PROJECT_ID}.iam.gserviceaccount.com

Set the GOOGLE_APPLICATION_CREDENTIALS environment variable to point to where you just put your Service Account key:

export GOOGLE_APPLICATION_CREDENTIALS="/home/${USER}/key.json"

Running locally

Create a virtual environment and install dependencies:

virtualenv -p python3 env
source env/bin/activate
pip install -r requirements.txt

Create a Cloud Storage bucket. It is recommended that you name it the same as your project ID:

gsutil mb gs://${PROJECT_ID}

Set the environment variable CLOUD_STORAGE_BUCKET:

export CLOUD_STORAGE_BUCKET=${PROJECT_ID}

Start your application locally:

python main.py

Visit localhost:8080 to view your application running locally. Press Control-C on your command line when you are finished.

When you are ready to leave your virtual environment:

deactivate

Deploying to App Engine

Open app.yaml and replace with the name of your Cloud Storage bucket.

Deploy your application to App Engine using gcloud. Please note that this may take several minutes.

gcloud app deploy

Visit https://[YOUR_PROJECT_ID].appspot.com to view your deployed application.

About

This repository contains the Web application to convert Image Text To Audio using Google Cloud Platform (GCP) Resources

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published