/frae

Fun recognizer

Primary LanguagePython

What

A wrapper for google's vision api run on a raspberry pi with an attached pi camera.

How

Via PiCamera, snap a picture. Generate a hash from resulting pic (sha256), upload file to GCP storage named after the hash. Call the Vision label API, return what it lists.

Future

Separate the steps into individual pieces to limit memory footprint of each piece and make them more granularly usable (ie, batch jobs, delayed labeling, etc). Save results to a DB for referencable future use.

Things

Setup your GCP account over at https://console.cloud.google.com/ Sign up for free trial and/or create a project. Check api manager to make sure cloud storage is enabled. This appears to be the default.

Stuff

Google's gcloud and gsutil tools can be run on a pi, though they no longer package them for ARM architecture.

To run without constantly authenticating, use the following:

  • python lib/gcloud.py components install beta app-engine-python
  • python lib/gcloud.py auth login
  • python lib/gcloud.py beta auth application-default login
  • python lib/gcloud.py config set project $PROJECT_NAME_FROM_ABOVE