saritha5 commited on
Commit
1859f7d
·
1 Parent(s): bd234d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -11
app.py CHANGED
@@ -28,7 +28,9 @@ import os
28
  from io import BytesIO
29
  import h5py
30
 
31
- st.title('Image Bluriness Occulded')
 
 
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
- f = st.file_uploader('Upload an Image',type=(["jpeg","jpg","png"]))
67
- if f is not None:
68
- image_path = f.name
69
- st.image(image_path)
70
  else:
71
- image_path = None
72
-
73
- predicted_label,variance_score = blurr_predict(image_path)
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)))