Coder Social home page Coder Social logo

potatoe88888 / cs361--microservice Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1017 KB

Utilizes Google Vision API and python libraries. Three tasks are outputted: delete image metadata, gather image metadata (labels, landmarks, logos, text), and gather/save image metadata to image.

License: GNU General Public License v3.0

Python 100.00%

cs361--microservice's Introduction

microservice

This program utilizes Google Vision API and python librarys to execute three tasks:

  1. Delete metadata image tags from uploaded image files.
  2. Process uploaded image with Google Vision API (labels, landmarks, logos, text gathering) with potential labels.
  3. Process and save image with potential labels found using Google Vision API.

microservice -- connect your Google cred

  1. Walk through this Google tutorial to set a basic set up: get_set_up
  2. There will become a point where you will be given a (.json) file. Save it, and know where this location is.
  3. Within the imageMETADATA.py file, you will see a place that says credential_path = "", within the "", place the location of the file
  4. TIP :: easiest way to ensure this works is to place this file within the same directory/folder as this imageMETADATA.py and reference only the "filenamehere.json" within the code.
  5. First time around, I did not set up the Cloud SDK within the setup page, helpful reminder, do actually do this.

microservice -- Python libraries needed

os, sys, io, json, PIL, exif

microservice -- how to run (main application should be running)

  1. Navigate to your directory which will hold this repository through terminal of choice.
  2. Upload your photos into the photo directory.
  3. Depending on your python PATH variable set up, you could be using 'python' or 'python3', figure this out before proceeding the user could also house another variable other than these for python running more info? check out Source 1 and Source 2. Run (imageMETEDATA_broker.py).
$python imageMETADATA_broker.py

--or --

$python3 imageMETADATA_broker.py
  1. Checkout the three url_paths set up for the user, wihthin a current local host, replace [PORT NUMER HERE] with actual desired port number (excluding '[ ]') and add some image path you want, there is a sample set to try out on this repository, for example, replace [INSERT FILE HERE] with photos/nyc_has_text.JPG (excluding '[ ]')
http://127.0.0.1:[PORT NUMER HERE]/image_process_only?url=[INSERT FILE HERE]

(ex. http://127.0.0.1:5000/image_process_only?url=photos/nyc_has_text.JPG)

http://127.0.0.1:[PORT NUMER HERE]/image_process_with_save?url=[INSERT FILE HERE]

(ex. http://127.0.0.1:5000/image_process_with_save?url=photos/nyc_has_text.JPG)

http://127.0.0.1:[PORT NUMER HERE]/image_del_METADATA?url=[INSERT FILE HERE]

(ex. http://127.0.0.1:5000/image_del_METADATA?url=photos/nyc_has_text.JPG)

  1. Review the terminal outputs or see within the browser the JSON output (if applicable to URL). Ability to process image labels and add them as image_description metadata AND ability to delete metadata are now in your hands.
  2. Alternatively, you can look at each image file's property before and after the manipulation to confirm the expected output is what you are looking for.

microservice -- sources

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.