saritha5 commited on
Commit
033809f
·
1 Parent(s): 6e1a614

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -93,9 +93,9 @@ if page == "Blurred or Not Blurred Prediction":
93
  else:
94
  st.title("Prediction of Occluded or not Occluded ")
95
  #plt. figure(figsize=(10,9))
96
- def occ_predict(img_content):
97
  im = []
98
- image=cv2.imread(img_content)
99
  #imgplot = plt.imshow(image)
100
  #plt.show()
101
  img = Image.fromarray(image, 'RGB')
@@ -124,14 +124,14 @@ else:
124
  if f is None:
125
  st.write("Please upload an image file")
126
  else:
127
- stringio = StringIO(f.getvalue())
128
- f = stringio.read()
129
  st.write(f)
130
  image1= Image.open(f)
131
  st.image(image1,use_column_width = True)
132
- image_path = Path(f.name)
133
  st.write(image_path)
134
- predicted_label,variance_score = occ_predict(image_path)
135
  #st.header(predicted_label)
136
  #st.header(str(round(variance_score,2)))
137
  string1 = "The image is," + predicted_label + " with the score value of " + str(round(variance_score,2))
 
93
  else:
94
  st.title("Prediction of Occluded or not Occluded ")
95
  #plt. figure(figsize=(10,9))
96
+ def occ_predict(imgpath):
97
  im = []
98
+ image=cv2.imread(imgpath)
99
  #imgplot = plt.imshow(image)
100
  #plt.show()
101
  img = Image.fromarray(image, 'RGB')
 
124
  if f is None:
125
  st.write("Please upload an image file")
126
  else:
127
+ #stringio = StringIO(f.getvalue())
128
+ #f = stringio.read()
129
  st.write(f)
130
  image1= Image.open(f)
131
  st.image(image1,use_column_width = True)
132
+ #image_path = Path(f.name)
133
  st.write(image_path)
134
+ predicted_label,variance_score = occ_predict(f)
135
  #st.header(predicted_label)
136
  #st.header(str(round(variance_score,2)))
137
  string1 = "The image is," + predicted_label + " with the score value of " + str(round(variance_score,2))