saritha5 commited on
Commit
9deebe5
·
1 Parent(s): 7efabe0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -25,13 +25,13 @@ import skimage
25
  from skimage.transform import resize
26
  import random
27
  import os
28
- from io import BytesIO
29
  import h5py
30
 
31
 
32
  page_names = ["Blurred or Not Blurred Prediction","Occluded or Not Occluded Prediction"]
33
  page = st.sidebar.radio('Navigation',page_names)
34
- st.write("Welcome to the Project")
35
 
36
  if page == "Blurred or Not Blurred Prediction":
37
  st.title("""
@@ -89,7 +89,7 @@ if page == "Blurred or Not Blurred Prediction":
89
  st.subheader(string)
90
  else:
91
  st.title("Prediction of Occluded or not Occluded ")
92
- plt. figure(figsize=(10,9))
93
  def occ_predict(img_content):
94
  im = []
95
  image=cv2.imread(img_content)
@@ -113,7 +113,7 @@ else:
113
  f = st.file_uploader('Upload an Image',type=(["jpeg","jpg","png"]))
114
  #st.write(f)
115
  #st.subheader("Prediction of Occluded or Not Occluded")
116
- images1 = ["Occulded.jpg","img1.png","img2.png","img3.png","img4.png"]
117
  with st.sidebar:
118
  st.write("choose an image")
119
  st.image(images1)
@@ -124,7 +124,7 @@ else:
124
  image1= Image.open(f)
125
  st.image(image1,use_column_width = True)
126
  image_path = f.name
127
- predicted_label,variance_score = occ_predict(image_path)
128
  #st.header(predicted_label)
129
  #st.header(str(round(variance_score,2)))
130
  string1 = "The image is," + predicted_label + " with the score value of " + str(round(variance_score,2))
 
25
  from skimage.transform import resize
26
  import random
27
  import os
28
+ from io import BytesIO,StringIO
29
  import h5py
30
 
31
 
32
  page_names = ["Blurred or Not Blurred Prediction","Occluded or Not Occluded Prediction"]
33
  page = st.sidebar.radio('Navigation',page_names)
34
+ #st.write("Welcome to the Project")
35
 
36
  if page == "Blurred or Not Blurred Prediction":
37
  st.title("""
 
89
  st.subheader(string)
90
  else:
91
  st.title("Prediction of Occluded or not Occluded ")
92
+ #plt. figure(figsize=(10,9))
93
  def occ_predict(img_content):
94
  im = []
95
  image=cv2.imread(img_content)
 
113
  f = st.file_uploader('Upload an Image',type=(["jpeg","jpg","png"]))
114
  #st.write(f)
115
  #st.subheader("Prediction of Occluded or Not Occluded")
116
+ images1 = ["/img1.png","img2.png","img3.png","img4.png"]
117
  with st.sidebar:
118
  st.write("choose an image")
119
  st.image(images1)
 
124
  image1= Image.open(f)
125
  st.image(image1,use_column_width = True)
126
  image_path = f.name
127
+ predicted_label,variance_score = occ_predict(f)
128
  #st.header(predicted_label)
129
  #st.header(str(round(variance_score,2)))
130
  string1 = "The image is," + predicted_label + " with the score value of " + str(round(variance_score,2))