Giter Site home page Giter Site logo

image-label-gmail's Introduction

image-label-gmail

This program labels emails in Gmail after analyzing attached images with Google Vision.

GCP APIs

In order to use the program you need a GCP project with the following APIs enabled:

  • Google Vision API
  • GMail API

Credentials for GCP

Service account with access for Google Vision set env. variable: GOOGLE_APPLICATION_CREDENTIALS.

Store the credentials for OAuth 2.0 client ID (for the GCP project) in file "src/main/resources/credentials.json"

OAuth Authentication

The first time you run the program a web browser will open where you choose which Gmail account the program should get access to - this generates a token which is stored in "tokens".

Building

mvn clean compile assembly:single

Resulting jar pops out in target/GmailImageAnalyzerAndLabeller.jar

How to deploy / run

Running the first time

  • Set GOOGLE_APPLICATION_CREDENTIALS to the service account connected to your GCP project.
  • $java -jar target/GmailImageAnalyzerAndLabeller.jar
  • Fill out the Oauth prompt to grant the application (i.e. your GCP project) access to the gmail acount you want to use.

Finished! the program should run.

Renewing tokens

The stored credentials for the Gmail connection expires after 6 months.

Running with saved token (running consequent times after first)

Make sure tokens folder is in the same dir as current dir.

$java -jar GmailImageAnalyzerAndLabeller.jar

List of animal names

Stolen from https://en.wikipedia.org/wiki/List_of_animal_names

image-label-gmail's People

Contributors

pettersoderlund avatar

Watchers

 avatar

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.