Spaces:
Sleeping
Sleeping
update
Browse files
utils.py
CHANGED
@@ -8,14 +8,15 @@ from PIL import Image
|
|
8 |
import albumentations as A
|
9 |
from albumentations.pytorch import ToTensorV2
|
10 |
import tempfile
|
|
|
11 |
|
12 |
def getcredentials():
|
13 |
secret_key_credential = os.getenv("cloud_vision")
|
14 |
|
15 |
with tempfile.NamedTemporaryFile(mode='w+', delete= True, suffix=".json") as temp_file:
|
16 |
-
|
17 |
-
|
18 |
-
tempfile_name =
|
19 |
|
20 |
return tempfile_name
|
21 |
##
|
|
|
8 |
import albumentations as A
|
9 |
from albumentations.pytorch import ToTensorV2
|
10 |
import tempfile
|
11 |
+
import json
|
12 |
|
13 |
def getcredentials():
|
14 |
secret_key_credential = os.getenv("cloud_vision")
|
15 |
|
16 |
with tempfile.NamedTemporaryFile(mode='w+', delete= True, suffix=".json") as temp_file:
|
17 |
+
temp_file.write(json.dumps(secret_key_credential))
|
18 |
+
|
19 |
+
tempfile_name = temp_file.name
|
20 |
|
21 |
return tempfile_name
|
22 |
##
|