akhaliq HF staff commited on
Commit
a45206d
β€’
1 Parent(s): 577d36b

Add resize

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -46,7 +46,10 @@ def detect(img,model):
46
  parser.add_argument('--exist-ok', action='store_true', help='existing project/name ok, do not increment')
47
  parser.add_argument('--trace', action='store_true', help='trace model')
48
  opt = parser.parse_args()
49
- img.save("Inference/test.jpg")
 
 
 
50
  source, weights, view_img, save_txt, imgsz, trace = opt.source, opt.weights, opt.view_img, opt.save_txt, opt.img_size, opt.trace
51
  save_img = True # save inference images
52
  webcam = source.isnumeric() or source.endswith('.txt') or source.lower().startswith(
 
46
  parser.add_argument('--exist-ok', action='store_true', help='existing project/name ok, do not increment')
47
  parser.add_argument('--trace', action='store_true', help='trace model')
48
  opt = parser.parse_args()
49
+
50
+ if model == "yolov7":
51
+ img.resize((640, 640))
52
+ img.save("Inference/test.jpg")
53
  source, weights, view_img, save_txt, imgsz, trace = opt.source, opt.weights, opt.view_img, opt.save_txt, opt.img_size, opt.trace
54
  save_img = True # save inference images
55
  webcam = source.isnumeric() or source.endswith('.txt') or source.lower().startswith(