saritha5 commited on
Commit
41e661b
·
1 Parent(s): 9deebe5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -92,6 +92,7 @@ else:
92
  #plt. figure(figsize=(10,9))
93
  def occ_predict(img_content):
94
  im = []
 
95
  image=cv2.imread(img_content)
96
  #imgplot = plt.imshow(image)
97
  #plt.show()
@@ -113,7 +114,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 = ["/img1.png","img2.png","img3.png","img4.png"]
117
  with st.sidebar:
118
  st.write("choose an image")
119
  st.image(images1)
@@ -121,10 +122,11 @@ else:
121
  if f is None:
122
  st.write("Please upload an image file")
123
  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(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))
 
92
  #plt. figure(figsize=(10,9))
93
  def occ_predict(img_content):
94
  im = []
95
+ st.write(img_content)
96
  image=cv2.imread(img_content)
97
  #imgplot = plt.imshow(image)
98
  #plt.show()
 
114
  f = st.file_uploader('Upload an Image',type=(["jpeg","jpg","png"]))
115
  #st.write(f)
116
  #st.subheader("Prediction of Occluded or Not Occluded")
117
+ images1 = ["img1.png","img2.png","img3.png","img4.png"]
118
  with st.sidebar:
119
  st.write("choose an image")
120
  st.image(images1)
 
122
  if f is None:
123
  st.write("Please upload an image file")
124
  else:
125
+ st.write(f.name)
126
  image1= Image.open(f)
127
  st.image(image1,use_column_width = True)
128
  image_path = f.name
129
+ predicted_label,variance_score = occ_predict(f.name)
130
  #st.header(predicted_label)
131
  #st.header(str(round(variance_score,2)))
132
  string1 = "The image is," + predicted_label + " with the score value of " + str(round(variance_score,2))