saritha5 commited on
Commit
bd234d5
·
1 Parent(s): 8a68876

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -48,7 +48,7 @@ def blurr_predict(img_iter):
48
  def make_prediction(img_content):
49
  pil_image = Image.open(img_content)
50
  imgplot = plt.imshow(pil_image)
51
- st.image(pil_image)
52
  plt.show()
53
  gray_cvimage = cv2.cvtColor(np.array(pil_image), cv2.COLOR_RGB2GRAY)
54
  #print(gray_cvimage)
@@ -63,7 +63,14 @@ def blurr_predict(img_iter):
63
  return predicted_label,variance_score
64
 
65
  #image_path = "images_11.jpeg"
66
- image_path = st.file_uploader('Upload an Image',type=(["jpeg","jpg","png"]))
 
 
 
 
 
 
67
  predicted_label,variance_score = blurr_predict(image_path)
68
  st.header(predicted_label)
 
69
  #st.("The image is", '\033[1m' + str(predicted_label) + '\033[0m', "with the score value of" +str(round(variance_score,2)))
 
48
  def make_prediction(img_content):
49
  pil_image = Image.open(img_content)
50
  imgplot = plt.imshow(pil_image)
51
+ #st.image(pil_image)
52
  plt.show()
53
  gray_cvimage = cv2.cvtColor(np.array(pil_image), cv2.COLOR_RGB2GRAY)
54
  #print(gray_cvimage)
 
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)))