val.py refactor (#4053)
* val.py refactor * cleanup * cleanup * cleanup * cleanup * save after eval * opt.imgsz bug fix * wandb refactor * dataloader to train_loader * capitalize global variables * runs/hub/exp to runs/detect/exp * refactor wandb logging * Refactor wandb operations (#4061) Co-authored-by: Ayush Chaurasia <ayush.chaurarsia@gmail.com>
This commit is contained in:
1 parent
9dd33fd20f
commit
f7d8562060
8 files changed
+219
-202
No files matched your search
@@ -21,7 +21,7 @@ from utils.datasets import LoadStreams, LoadImages
|
||||
from utils.general import check_img_size, check_requirements, check_imshow, colorstr, non_max_suppression, \
|
||||
apply_classifier, scale_coords, xyxy2xywh, strip_optimizer, set_logging, increment_path, save_one_box
|
||||
from utils.plots import colors, plot_one_box
|
||||
from utils.torch_utils import select_device, load_classifier, time_synchronized
|
||||
from utils.torch_utils import select_device, load_classifier, time_sync
|
||||
|
||||
|
||||
@torch.no_grad()
|
||||
@@ -100,14 +100,14 @@ def run(weights='yolov5s.pt', # model.pt path(s)
|
||||
img = img.unsqueeze(0)
|
||||
|
||||
# Inference
|
||||
t1 = time_synchronized()
|
||||
t1 = time_sync()
|
||||
pred = model(img,
|
||||
augment=augment,
|
||||
visualize=increment_path(save_dir / Path(path).stem, 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)
|
||||
t2 = time_synchronized()
|
||||
t2 = time_sync()
|
||||
|
||||
# Apply Classifier
|
||||
if classify:
|
||||
|
||||
Reference in new issue
Block a user