saritha5 commited on
Commit
45da06f
·
1 Parent(s): 7ab5dbc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -3
app.py CHANGED
@@ -95,12 +95,22 @@ else:
95
  #plt. figure(figsize=(10,9))
96
  def occ_predict(imgpath):
97
  im = []
98
- imgpath = str(imgpath)
99
- image=cv2.imread(imgpath,CV_LOAD_IMAGE_COLOR)
 
 
 
 
 
 
 
 
 
 
100
 
101
  #imgplot = plt.imshow(image)
102
  #plt.show()
103
- img = Image.fromarray(image, 'RGB')
104
  resize_image = img.resize((50, 50))
105
  im.append(np.array(resize_image))
106
  fv = np.array(im)
 
95
  #plt. figure(figsize=(10,9))
96
  def occ_predict(imgpath):
97
  im = []
98
+ import cv2
99
+ import os.path
100
+
101
+ while not os.path.isfile(imagepath):
102
+ #ignore if no such file is present.
103
+ pass
104
+
105
+ img = cv2.imread("myImage.jpg", 0)
106
+
107
+ cv2.imwrite("result.jpg", img)
108
+ imgpath = str(result.jpg)
109
+ image=cv2.imread(imgpath)
110
 
111
  #imgplot = plt.imshow(image)
112
  #plt.show()
113
+ img = Image.fromarray(result.jpg, 'RGB')
114
  resize_image = img.resize((50, 50))
115
  im.append(np.array(resize_image))
116
  fv = np.array(im)