Update app.py
Browse files
app.py
CHANGED
|
@@ -27,14 +27,13 @@ if uploaded_file is not None:
|
|
| 27 |
img = Image.open(uploaded_file)
|
| 28 |
st.image(img)
|
| 29 |
img = np.array(img)
|
| 30 |
-
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
| 31 |
-
|
| 32 |
cust_transform = A.Compose([A.Resize(height=256, width=256, p=1.0),ToTensorV2(p=1.0)], p=1.0)
|
| 33 |
tensor = cust_transform(image=img)
|
| 34 |
tensor = tensor['image'].float().resize(1,3,256,256)
|
| 35 |
|
| 36 |
-
custom_pred = model.forward(tensor).detach().numpy()
|
| 37 |
-
custom_pred
|
| 38 |
|
| 39 |
st.write(f'Predicted: {id2class[np.argmax(custom_pred)]}')
|
| 40 |
elif '.csv' in uploaded_file.name:
|
|
|
|
| 27 |
img = Image.open(uploaded_file)
|
| 28 |
st.image(img)
|
| 29 |
img = np.array(img)
|
| 30 |
+
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
|
|
|
| 31 |
cust_transform = A.Compose([A.Resize(height=256, width=256, p=1.0),ToTensorV2(p=1.0)], p=1.0)
|
| 32 |
tensor = cust_transform(image=img)
|
| 33 |
tensor = tensor['image'].float().resize(1,3,256,256)
|
| 34 |
|
| 35 |
+
custom_pred = model.forward(tensor).detach().numpy()
|
| 36 |
+
#custom_pred
|
| 37 |
|
| 38 |
st.write(f'Predicted: {id2class[np.argmax(custom_pred)]}')
|
| 39 |
elif '.csv' in uploaded_file.name:
|