Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -95,22 +95,12 @@ else:
|
|
95 |
#plt. figure(figsize=(10,9))
|
96 |
def occ_predict(imgpath):
|
97 |
im = []
|
98 |
-
|
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(
|
114 |
resize_image = img.resize((50, 50))
|
115 |
im.append(np.array(resize_image))
|
116 |
fv = np.array(im)
|
|
|
95 |
#plt. figure(figsize=(10,9))
|
96 |
def occ_predict(imgpath):
|
97 |
im = []
|
98 |
+
st.header(imgpath)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
image=cv2.imread(imgpath)
|
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)
|