added README

This commit is contained in:
Xevion
2019-08-20 19:48:35 -05:00
parent 66a344d35a
commit e95f61c534
3 changed files with 14 additions and 10 deletions

View File

@@ -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`.
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

10
main.py
View File

@@ -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))
if __name__ == "__main__":
sys.exit(app.run())

View File

@@ -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)