anh1811 commited on
Commit
97a2cd7
·
1 Parent(s): 360f270

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -280,7 +280,8 @@ def plot_image(image, boxes, image_ori=None):
280
  def infer(model, img, thresh, iou_thresh, anchors):
281
  model.eval()
282
  image = np.array(img)
283
- print(image.shape)
 
284
  image_copy = image.copy()
285
  # image = image[np.newaxis, :]
286
  augmentations = infer_transforms(image=image)
@@ -350,7 +351,7 @@ scaled_anchors = (
350
 
351
  uploaded_file = st.file_uploader("Chọn hình ảnh...", type=["jpg", "jpeg", "png"])
352
  # uploaded_file = '/home/ngocanh/Documents/final_thesis/code/dataset/10_10/base/images/test/000011.jpg'
353
- if uploaded_file is not None:ssssssssssssssssssssssssssss
354
  image = Image.open(uploaded_file)
355
  print("Thuc hien bien doi")
356
 
 
280
  def infer(model, img, thresh, iou_thresh, anchors):
281
  model.eval()
282
  image = np.array(img)
283
+ image = image[:, :, :3]
284
+ # print(image.shape)
285
  image_copy = image.copy()
286
  # image = image[np.newaxis, :]
287
  augmentations = infer_transforms(image=image)
 
351
 
352
  uploaded_file = st.file_uploader("Chọn hình ảnh...", type=["jpg", "jpeg", "png"])
353
  # uploaded_file = '/home/ngocanh/Documents/final_thesis/code/dataset/10_10/base/images/test/000011.jpg'
354
+ if uploaded_file is not None:
355
  image = Image.open(uploaded_file)
356
  print("Thuc hien bien doi")
357