From e95f61c5347e97f4d45891e77351b13fcfbae9f6 Mon Sep 17 00:00:00 2001 From: Xevion Date: Tue, 20 Aug 2019 19:48:35 -0500 Subject: [PATCH] added README --- README.md | 12 +++++++++++- main.py | 10 ++-------- package/app.py | 2 +- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 858c824..f3cb28e 100644 --- a/README.md +++ b/README.md @@ -6,4 +6,14 @@ This repository is for a interesting project involving Google's Vision API and s ## How does it work? -This application is built in Python and utilizes the `google-cloud` python module. Install using `pip install google-cloud`. A key should be provided by google in a `.json` file, insert this at `./package/key/photo_tagging_service.json`. \ No newline at end of file +This application is built in Python and utilizes the `google-cloud` python module. Install using `pip install google-cloud`. A key should be provided by google in a `.json` file, insert this at `./package/key/photo_tagging_service.json`. + +## Features + +Automatic tagging of photos using a high quality Vision API + +Automatic compression of photos for minimal data usage on both your and Google's end + +Support for .NEF RAW file compression with .XMP metadata files. + +- With added support for all non .NEF files with basic \ No newline at end of file diff --git a/main.py b/main.py index 977ab23..9fd911a 100644 --- a/main.py +++ b/main.py @@ -3,11 +3,5 @@ from package import app os.environ["GOOGLE_APPLICATION_CREDENTIALS"]=os.path.join(sys.path[0], 'package', 'key', 'photo_tagging_service.json') -# if __name__ == "__main__": -# sys.exit(app.run()) - -import exif -path = 'E:\\Photography\\Colorado 2019\\DSC_7960.jpg' -image = exif.Image(open(path, 'rb')) -print(image.artist) -print(dir(image)) \ No newline at end of file +if __name__ == "__main__": + sys.exit(app.run()) \ No newline at end of file diff --git a/package/app.py b/package/app.py index 24e3b58..79550e4 100644 --- a/package/app.py +++ b/package/app.py @@ -58,7 +58,7 @@ def process_file(file_name, xmp): bytesIO = io.BytesIO() image.save(bytesIO, format='jpeg') image.close() - image = types.Image(content=bytesIO.getvalue()) + image = vision.types.Image(content=bytesIO.getvalue()) # Performs label detection on the image file response = client.label_detection(image=image)