Feature visualization update (#3920)
* Feature visualization update * Save to jpg (faster) * Save to png
This commit is contained in:
1 parent
61047a2b4f
commit
87b094bcbc
3 files changed
+26
-26
No files matched your search
@@ -40,6 +40,7 @@ def run(weights='yolov5s.pt', # model.pt path(s)
|
||||
classes=None, # filter by class: --class 0, or --class 0 2 3
|
||||
agnostic_nms=False, # class-agnostic NMS
|
||||
augment=False, # augmented inference
|
||||
visualize=False, # visualize features
|
||||
update=False, # update all models
|
||||
project='runs/detect', # save results to project/name
|
||||
name='exp', # save results to project/name
|
||||
@@ -100,7 +101,9 @@ def run(weights='yolov5s.pt', # model.pt path(s)
|
||||
|
||||
# Inference
|
||||
t1 = time_synchronized()
|
||||
pred = model(img, augment=augment)[0]
|
||||
pred = model(img,
|
||||
augment=augment,
|
||||
visualize=increment_path(save_dir / 'features', mkdir=True) if visualize else False)[0]
|
||||
|
||||
# Apply NMS
|
||||
pred = non_max_suppression(pred, conf_thres, iou_thres, classes, agnostic_nms, max_det=max_det)
|
||||
@@ -201,6 +204,7 @@ def parse_opt():
|
||||
parser.add_argument('--classes', nargs='+', type=int, help='filter by class: --class 0, or --class 0 2 3')
|
||||
parser.add_argument('--agnostic-nms', action='store_true', help='class-agnostic NMS')
|
||||
parser.add_argument('--augment', action='store_true', help='augmented inference')
|
||||
parser.add_argument('--visualize', action='store_true', help='visualize features')
|
||||
parser.add_argument('--update', action='store_true', help='update all models')
|
||||
parser.add_argument('--project', default='runs/detect', help='save results to project/name')
|
||||
parser.add_argument('--name', default='exp', help='save results to project/name')
|
||||
|
||||
Reference in new issue
Block a user