Skip to content

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

Notifications You must be signed in to change notification settings

potatoe88888/CS361--microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages