Commit
•
1fdaa49
1
Parent(s):
11ba529
update detect.py
Browse files
detect.py
CHANGED
@@ -102,7 +102,7 @@ def detect(save_img=False):
|
|
102 |
|
103 |
if save_img or view_img: # Add bbox to image
|
104 |
label = '%s %.2f' % (names[int(cls)], conf)
|
105 |
-
plot_one_box(xyxy, im0, label=label, color=colors[int(cls)], line_thickness=
|
106 |
|
107 |
# Print time (inference + NMS)
|
108 |
print('%sDone. (%.3fs)' % (s, t2 - t1))
|
@@ -139,10 +139,10 @@ def detect(save_img=False):
|
|
139 |
|
140 |
if __name__ == '__main__':
|
141 |
parser = argparse.ArgumentParser()
|
142 |
-
parser.add_argument('--weights', type=str, default='weights/
|
143 |
parser.add_argument('--source', type=str, default='inference/images', help='source') # file/folder, 0 for webcam
|
144 |
parser.add_argument('--output', type=str, default='inference/output', help='output folder') # output folder
|
145 |
-
parser.add_argument('--img-size', type=int, default=
|
146 |
parser.add_argument('--conf-thres', type=float, default=0.4, help='object confidence threshold')
|
147 |
parser.add_argument('--iou-thres', type=float, default=0.5, help='IOU threshold for NMS')
|
148 |
parser.add_argument('--fourcc', type=str, default='mp4v', help='output video codec (verify ffmpeg support)')
|
|
|
102 |
|
103 |
if save_img or view_img: # Add bbox to image
|
104 |
label = '%s %.2f' % (names[int(cls)], conf)
|
105 |
+
plot_one_box(xyxy, im0, label=label, color=colors[int(cls)], line_thickness=3)
|
106 |
|
107 |
# Print time (inference + NMS)
|
108 |
print('%sDone. (%.3fs)' % (s, t2 - t1))
|
|
|
139 |
|
140 |
if __name__ == '__main__':
|
141 |
parser = argparse.ArgumentParser()
|
142 |
+
parser.add_argument('--weights', type=str, default='weights/yolov5s.pt', help='model.pt path')
|
143 |
parser.add_argument('--source', type=str, default='inference/images', help='source') # file/folder, 0 for webcam
|
144 |
parser.add_argument('--output', type=str, default='inference/output', help='output folder') # output folder
|
145 |
+
parser.add_argument('--img-size', type=int, default=640, help='inference size (pixels)')
|
146 |
parser.add_argument('--conf-thres', type=float, default=0.4, help='object confidence threshold')
|
147 |
parser.add_argument('--iou-thres', type=float, default=0.5, help='IOU threshold for NMS')
|
148 |
parser.add_argument('--fourcc', type=str, default='mp4v', help='output video codec (verify ffmpeg support)')
|