Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -23,7 +23,7 @@ def Custom_detect(img):
|
|
23 |
model='best'
|
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='
|
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')
|
@@ -41,7 +41,7 @@ def Custom_detect(img):
|
|
41 |
parser.add_argument('--exist-ok', action='store_true', help='existing project/name ok, do not increment')
|
42 |
parser.add_argument('--trace', action='store_true', help='trace model')
|
43 |
opt = parser.parse_args()
|
44 |
-
img.save("
|
45 |
source, weights, view_img, save_txt, imgsz, trace = opt.source, opt.weights, opt.view_img, opt.save_txt, opt.img_size, opt.trace
|
46 |
save_img = True
|
47 |
webcam = source.isnumeric() or source.endswith('.txt') or source.lower().startswith(('rtsp://', 'rtmp://', 'http://', 'https://'))
|
@@ -123,7 +123,7 @@ def Custom_detect(img):
|
|
123 |
|
124 |
if save_img or view_img:
|
125 |
label = f'{names[int(cls)]} {conf:.2f}'
|
126 |
-
plot_one_box(xyxy, im0, label=label, color=colors[int(cls)], line_thickness=
|
127 |
if view_img:
|
128 |
cv2.imshow(str(p), im0)
|
129 |
cv2.waitKey(1)
|
|
|
23 |
model='best'
|
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_files/', 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')
|
|
|
41 |
parser.add_argument('--exist-ok', action='store_true', help='existing project/name ok, do not increment')
|
42 |
parser.add_argument('--trace', action='store_true', help='trace model')
|
43 |
opt = parser.parse_args()
|
44 |
+
img.save("Temp_files/test.jpg")
|
45 |
source, weights, view_img, save_txt, imgsz, trace = opt.source, opt.weights, opt.view_img, opt.save_txt, opt.img_size, opt.trace
|
46 |
save_img = True
|
47 |
webcam = source.isnumeric() or source.endswith('.txt') or source.lower().startswith(('rtsp://', 'rtmp://', 'http://', 'https://'))
|
|
|
123 |
|
124 |
if save_img or view_img:
|
125 |
label = f'{names[int(cls)]} {conf:.2f}'
|
126 |
+
plot_one_box(xyxy, im0, label=label, color=colors[int(cls)], line_thickness=2)
|
127 |
if view_img:
|
128 |
cv2.imshow(str(p), im0)
|
129 |
cv2.waitKey(1)
|