Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,7 @@ from utils.torch_utils import select_device, load_classifier, time_synchronized,
|
|
21 |
|
22 |
parser = argparse.ArgumentParser()
|
23 |
parser.add_argument('--weights', nargs='+', type=str, default='yolov7.pt', help='model.pt path(s)')
|
24 |
-
parser.add_argument('--source', type=str, default='inference/
|
25 |
parser.add_argument('--img-size', type=int, default=640, help='inference size (pixels)')
|
26 |
parser.add_argument('--conf-thres', type=float, default=0.25, help='object confidence threshold')
|
27 |
parser.add_argument('--iou-thres', type=float, default=0.45, help='IOU threshold for NMS')
|
@@ -45,7 +45,7 @@ opt = parser.parse_args()
|
|
45 |
|
46 |
|
47 |
def detect(img):
|
48 |
-
img.save("
|
49 |
source, weights, view_img, save_txt, imgsz, trace = opt.source, opt.weights, opt.view_img, opt.save_txt, opt.img_size, opt.trace
|
50 |
save_img = True # save inference images
|
51 |
webcam = source.isnumeric() or source.endswith('.txt') or source.lower().startswith(
|
|
|
21 |
|
22 |
parser = argparse.ArgumentParser()
|
23 |
parser.add_argument('--weights', nargs='+', type=str, default='yolov7.pt', help='model.pt path(s)')
|
24 |
+
parser.add_argument('--source', type=str, default='inference/', help='source') # file/folder, 0 for webcam
|
25 |
parser.add_argument('--img-size', type=int, default=640, help='inference size (pixels)')
|
26 |
parser.add_argument('--conf-thres', type=float, default=0.25, help='object confidence threshold')
|
27 |
parser.add_argument('--iou-thres', type=float, default=0.45, help='IOU threshold for NMS')
|
|
|
45 |
|
46 |
|
47 |
def detect(img):
|
48 |
+
img.save("inference/test.jpg")
|
49 |
source, weights, view_img, save_txt, imgsz, trace = opt.source, opt.weights, opt.view_img, opt.save_txt, opt.img_size, opt.trace
|
50 |
save_img = True # save inference images
|
51 |
webcam = source.isnumeric() or source.endswith('.txt') or source.lower().startswith(
|