mirror of
https://github.com/Xevion/phototag.git
synced 2025-12-06 05:15:52 -06:00
added README
This commit is contained in:
12
README.md
12
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`.
|
||||
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
10
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))
|
||||
if __name__ == "__main__":
|
||||
sys.exit(app.run())
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user