|
|
@@ -102,7 +102,7 @@ def detect(save_img=False): |
|
|
|
|
|
|
|
if save_img or view_img: # Add bbox to image |
|
|
|
label = '%s %.2f' % (names[int(cls)], conf) |
|
|
|
plot_one_box(xyxy, im0, label=label, color=colors[int(cls)], line_thickness=3) |
|
|
|
plot_one_box(xyxy, im0, label=label, color=colors[int(cls)], line_thickness=1) |
|
|
|
|
|
|
|
# Print time (inference + NMS) |
|
|
|
print('%sDone. (%.3fs)' % (s, t2 - t1)) |
|
|
@@ -139,10 +139,10 @@ def detect(save_img=False): |
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
|
parser = argparse.ArgumentParser() |
|
|
|
parser.add_argument('--weights', type=str, default='weights/yolov5s.pt', help='model.pt path') |
|
|
|
parser.add_argument('--weights', type=str, default='weights/yolov5m.pt', help='model.pt path') |
|
|
|
parser.add_argument('--source', type=str, default='inference/images', help='source') # file/folder, 0 for webcam |
|
|
|
parser.add_argument('--output', type=str, default='inference/output', help='output folder') # output folder |
|
|
|
parser.add_argument('--img-size', type=int, default=640, help='inference size (pixels)') |
|
|
|
parser.add_argument('--img-size', type=int, default=1024, help='inference size (pixels)') |
|
|
|
parser.add_argument('--conf-thres', type=float, default=0.4, help='object confidence threshold') |
|
|
|
parser.add_argument('--iou-thres', type=float, default=0.5, help='IOU threshold for NMS') |
|
|
|
parser.add_argument('--fourcc', type=str, default='mp4v', help='output video codec (verify ffmpeg support)') |