From 4a4f1b380396e5e7ab69cd914ecf28a51c5cd934 Mon Sep 17 00:00:00 2001 From: Davide Tonelli Date: Tue, 9 Aug 2022 10:59:25 +0200 Subject: [PATCH] Auto key detection --- vision-env/src/vision-test.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vision-env/src/vision-test.py b/vision-env/src/vision-test.py index f4ce5eb..e2237f7 100644 --- a/vision-env/src/vision-test.py +++ b/vision-env/src/vision-test.py @@ -25,6 +25,10 @@ def shape_selection(event, x, y, flags, param): cv2.rectangle(image, ref_point[0], ref_point[1], (0, 255, 0), 2) cv2.imshow("image", image) +key_rel_path= os.path.join('..', 'keys', 'developerKey.json') +key = os.path.abspath(key_rel_path) +os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = key + # User input from the command line image_name = sys.argv[1]