Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -28,7 +28,9 @@ import os
|
|
28 |
from io import BytesIO
|
29 |
import h5py
|
30 |
|
31 |
-
st.title(
|
|
|
|
|
32 |
|
33 |
model_file_path = "mobile_net_occ.h5"
|
34 |
|
@@ -63,14 +65,13 @@ def blurr_predict(img_iter):
|
|
63 |
return predicted_label,variance_score
|
64 |
|
65 |
#image_path = "images_11.jpeg"
|
66 |
-
|
67 |
-
if
|
68 |
-
|
69 |
-
st.image(image_path)
|
70 |
else:
|
71 |
-
|
72 |
-
|
73 |
-
predicted_label,variance_score = blurr_predict(
|
74 |
-
st.header(predicted_label)
|
75 |
-
st.header(str(round(variance_score,2)))
|
76 |
-
#st.("The image is", '\033[1m' + str(predicted_label) + '\033[0m', "with the score value of" +str(round(variance_score,2)))
|
|
|
28 |
from io import BytesIO
|
29 |
import h5py
|
30 |
|
31 |
+
st.title("""
|
32 |
+
Image Blurriness Occluded
|
33 |
+
""")
|
34 |
|
35 |
model_file_path = "mobile_net_occ.h5"
|
36 |
|
|
|
65 |
return predicted_label,variance_score
|
66 |
|
67 |
#image_path = "images_11.jpeg"
|
68 |
+
file = st.file_uploader('Upload an Image',type=(["jpeg","jpg","png"]))
|
69 |
+
if file is None:
|
70 |
+
st.write("Please upload an image file")
|
|
|
71 |
else:
|
72 |
+
image= Image.open(file)
|
73 |
+
st.image(image,use_column_width = True)
|
74 |
+
predicted_label,variance_score = blurr_predict(file)
|
75 |
+
st.header(predicted_label)
|
76 |
+
st.header(str(round(variance_score,2)))
|
77 |
+
#st.("The image is", '\033[1m' + str(predicted_label) + '\033[0m', "with the score value of" +str(round(variance_score,2)))
|