Spaces:
Running
Running
secret key
Browse files
OCR.py
CHANGED
@@ -10,20 +10,10 @@ from eval import iou
|
|
10 |
from utils import class_dict, proportion_inside
|
11 |
import json
|
12 |
from utils import rescale_boxes as rescale
|
13 |
-
import streamlit as st
|
14 |
|
15 |
-
VISION_KEY = st.secrets["VISION_KEY"]
|
16 |
-
VISION_ENDPOINT = st.secrets["VISION_ENDPOINT"]
|
17 |
|
18 |
-
""
|
19 |
-
|
20 |
-
with open("VISION_KEY.json", "r") as json_file:
|
21 |
-
json_data = json.load(json_file)
|
22 |
-
|
23 |
-
# Step 2: Parse the JSON data (this is done by json.load automatically)
|
24 |
-
VISION_KEY = json_data["VISION_KEY"]
|
25 |
-
VISION_ENDPOINT = json_data["VISION_ENDPOINT"]
|
26 |
-
"""
|
27 |
|
28 |
|
29 |
def sample_ocr_image_file(image_data):
|
|
|
10 |
from utils import class_dict, proportion_inside
|
11 |
import json
|
12 |
from utils import rescale_boxes as rescale
|
|
|
13 |
|
|
|
|
|
14 |
|
15 |
+
VISION_KEY = os.getenv("VISION_KEY")
|
16 |
+
VISION_ENDPOINT = os.getenv("VISION_ENDPOINT")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
|
19 |
def sample_ocr_image_file(image_data):
|