Spaces:
Runtime error
Runtime error
Commit
·
f9abbe9
1
Parent(s):
319f7cb
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,12 +5,19 @@ import json
|
|
| 5 |
import numpy as np
|
| 6 |
import cv2
|
| 7 |
|
| 8 |
-
|
| 9 |
|
| 10 |
__class_name_to_number = {}
|
| 11 |
__class_number_to_name = {}
|
| 12 |
__model = None
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
def classify_image(image_base64_data, file_path=None):
|
| 15 |
|
| 16 |
imgs = get_cropped_image_if_2_eyes_new(file_path, image_base64_data)
|
|
@@ -87,8 +94,5 @@ def get_b64_test_image_for_virat():
|
|
| 87 |
with open("b64.txt") as f:
|
| 88 |
return f.read()
|
| 89 |
|
| 90 |
-
uploaded_image = st.file_uploader('Choose an image')
|
| 91 |
-
load_saved_artifacts()
|
| 92 |
|
| 93 |
-
st.text(classify_image(get_b64_test_image_for_virat(), "sharapova1.jpg"))
|
| 94 |
|
|
|
|
| 5 |
import numpy as np
|
| 6 |
import cv2
|
| 7 |
|
| 8 |
+
|
| 9 |
|
| 10 |
__class_name_to_number = {}
|
| 11 |
__class_number_to_name = {}
|
| 12 |
__model = None
|
| 13 |
|
| 14 |
+
st.title("Welcome!")
|
| 15 |
+
|
| 16 |
+
uploaded_image = st.file_uploader('Choose an image')
|
| 17 |
+
load_saved_artifacts()
|
| 18 |
+
|
| 19 |
+
st.text(classify_image(get_b64_test_image_for_virat(), "sharapova1.jpg"))
|
| 20 |
+
|
| 21 |
def classify_image(image_base64_data, file_path=None):
|
| 22 |
|
| 23 |
imgs = get_cropped_image_if_2_eyes_new(file_path, image_base64_data)
|
|
|
|
| 94 |
with open("b64.txt") as f:
|
| 95 |
return f.read()
|
| 96 |
|
|
|
|
|
|
|
| 97 |
|
|
|
|
| 98 |
|