Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -96,13 +96,13 @@ else:
|
|
96 |
#plt. figure(figsize=(10,9))
|
97 |
def occ_predict(imgpath):
|
98 |
im = []
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
resize_image = img.resize((50, 50))
|
107 |
im.append(np.array(resize_image))
|
108 |
fv = np.array(im)
|
@@ -111,6 +111,7 @@ else:
|
|
111 |
myModel = load_model(model_gcs)
|
112 |
prediction = myModel.predict(np_array_img)
|
113 |
score = prediction[0][0].item()
|
|
|
114 |
thresh = 0.5
|
115 |
if score > thresh:
|
116 |
return "Not Occluded",score
|
|
|
96 |
#plt. figure(figsize=(10,9))
|
97 |
def occ_predict(imgpath):
|
98 |
im = []
|
99 |
+
image1 = plt.imread(img_content)
|
100 |
+
|
101 |
+
st.write(img_content)
|
102 |
+
st.write(type(img_content))
|
103 |
+
|
104 |
+
img = Image.fromarray(image1, 'RGB')
|
105 |
+
st.write(type(image1))
|
106 |
resize_image = img.resize((50, 50))
|
107 |
im.append(np.array(resize_image))
|
108 |
fv = np.array(im)
|
|
|
111 |
myModel = load_model(model_gcs)
|
112 |
prediction = myModel.predict(np_array_img)
|
113 |
score = prediction[0][0].item()
|
114 |
+
|
115 |
thresh = 0.5
|
116 |
if score > thresh:
|
117 |
return "Not Occluded",score
|