Skip to content

A service to extract text from images using the Google Cloud.

License

Notifications You must be signed in to change notification settings

GillisWerrebrouck/text-extract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Text extraction service

Google cloud tutorial

Deployment

  • Create Google Cloud project
  • Enable billing in your account to be able to use most Google Cloud service
  • Enable APIS for the project (Cloud Functions API, Cloud Pub/Sub API, Google Cloud Storage JSON API, Cloud Translation API and Cloud Vision API)
  • Install the gcloud SDK
  • Initialize gcloud: gcloud init
  • Update gcloud and install beta components: gcloud components update && gcloud components install beta
  • Create an input and output bucket: gsutil mb gs://*YOUR_BUCKET_NAME*
  • Configure the app in config.json
  • Deploy image processing function: gcloud functions deploy ocr-extract --runtime nodejs8 --trigger-bucket *YOUR_IMAGE_BUCKET_NAME* --entry-point processImage
  • Deploy text translation function: gcloud functions deploy ocr-translate --runtime nodejs8 --trigger-topic *YOUR_TRANSLATE_TOPIC_NAME* --entry-point translateText
  • Deploy save results function: gcloud functions deploy ocr-save --runtime nodejs8 --trigger-topic *YOUR_RESULT_TOPIC_NAME* --entry-point saveResult
  • Test the service via cmd: gsutil cp *PATH_TO_IMAGE* gs://*YOUR_IMAGE_BUCKET_NAME*
  • Get last logs: gcloud functions logs read --limit 100

Test the code

npm test