youl commited on
Commit
cf72695
·
1 Parent(s): 28c66f1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import streamlit as st
2
  import torch
3
  import cv2
 
4
  import torch.nn as nn
5
  from torchvision.ops import box_iou
6
  from PIL import Image
@@ -52,7 +53,7 @@ file_name = st.file_uploader("Upload oil palm tree image")
52
  if file_name is not None:
53
  col1, col2 = st.columns(2)
54
 
55
- image = Image.open(file_name)
56
  col1.image(image, use_column_width=True)
57
  transformed = test_transforms(image= image)
58
  image_transformed = transformed["image"]
 
1
  import streamlit as st
2
  import torch
3
  import cv2
4
+ import numpy as np
5
  import torch.nn as nn
6
  from torchvision.ops import box_iou
7
  from PIL import Image
 
53
  if file_name is not None:
54
  col1, col2 = st.columns(2)
55
 
56
+ image = np.array(Image.open(file_name))
57
  col1.image(image, use_column_width=True)
58
  transformed = test_transforms(image= image)
59
  image_transformed = transformed["image"]