saritha5 commited on
Commit
6ff04d9
·
1 Parent(s): 21534bf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -96,13 +96,13 @@ else:
96
  #plt. figure(figsize=(10,9))
97
  def occ_predict(imgpath):
98
  im = []
99
- pil_image = Image.open(imgpath)
100
- #st.header(imgpath)
101
- #image=cv2.imread(imgpath)
102
-
103
- #imgplot = plt.imshow(image)
104
- #plt.show()
105
- img = Image.fromarray(pil_image, 'RGB')
106
  resize_image = img.resize((50, 50))
107
  im.append(np.array(resize_image))
108
  fv = np.array(im)
@@ -111,6 +111,7 @@ else:
111
  myModel = load_model(model_gcs)
112
  prediction = myModel.predict(np_array_img)
113
  score = prediction[0][0].item()
 
114
  thresh = 0.5
115
  if score > thresh:
116
  return "Not Occluded",score
 
96
  #plt. figure(figsize=(10,9))
97
  def occ_predict(imgpath):
98
  im = []
99
+ image1 = plt.imread(img_content)
100
+
101
+ st.write(img_content)
102
+ st.write(type(img_content))
103
+
104
+ img = Image.fromarray(image1, 'RGB')
105
+ st.write(type(image1))
106
  resize_image = img.resize((50, 50))
107
  im.append(np.array(resize_image))
108
  fv = np.array(im)
 
111
  myModel = load_model(model_gcs)
112
  prediction = myModel.predict(np_array_img)
113
  score = prediction[0][0].item()
114
+
115
  thresh = 0.5
116
  if score > thresh:
117
  return "Not Occluded",score