Sa-m commited on
Commit
7d18171
·
1 Parent(s): 6a16a24

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -24,7 +24,7 @@ def Custom_detect(img):
24
  parser = argparse.ArgumentParser()
25
  parser.add_argument('--weights', nargs='+', type=str, default=model+".pt", help='model.pt path(s)')
26
  parser.add_argument('--source', type=str, default='Temp_file/', help='source')
27
- parser.add_argument('--img-size', type=int, default=256, help='inference size (pixels)')
28
  parser.add_argument('--conf-thres', type=float, default=0.25, help='object confidence threshold')
29
  parser.add_argument('--iou-thres', type=float, default=0.45, help='IOU threshold for NMS')
30
  parser.add_argument('--device', default='', help='cuda device, i.e. 0 or 0,1,2,3 or cpu')
@@ -130,6 +130,7 @@ def Custom_detect(img):
130
 
131
  if save_img:
132
  if dataset.mode == 'image':
 
133
  cv2.imwrite(save_path, im0)
134
  else:
135
  if vid_path != save_path:
@@ -153,7 +154,7 @@ def Custom_detect(img):
153
 
154
  return Image.fromarray(im0[:,:,::-1])
155
  inp = gr.Image(type="pil")
156
- output = gr.Image(type="numpy").style(full_width=True, height=10)
157
  #gr.outputs.Image(type="filepath", label="Output")
158
  #.outputs.Textbox() ,api_mode=True
159
 
 
24
  parser = argparse.ArgumentParser()
25
  parser.add_argument('--weights', nargs='+', type=str, default=model+".pt", help='model.pt path(s)')
26
  parser.add_argument('--source', type=str, default='Temp_file/', help='source')
27
+ parser.add_argument('--img-size', type=int, default=100, help='inference size (pixels)')
28
  parser.add_argument('--conf-thres', type=float, default=0.25, help='object confidence threshold')
29
  parser.add_argument('--iou-thres', type=float, default=0.45, help='IOU threshold for NMS')
30
  parser.add_argument('--device', default='', help='cuda device, i.e. 0 or 0,1,2,3 or cpu')
 
130
 
131
  if save_img:
132
  if dataset.mode == 'image':
133
+ im0.shape
134
  cv2.imwrite(save_path, im0)
135
  else:
136
  if vid_path != save_path:
 
154
 
155
  return Image.fromarray(im0[:,:,::-1])
156
  inp = gr.Image(type="pil")
157
+ output = gr.Image(type="pil")
158
  #gr.outputs.Image(type="filepath", label="Output")
159
  #.outputs.Textbox() ,api_mode=True
160