|
|
|
|
|
|
|
|
hyp=None, augment=False, cache=False, pad=0.5, rect=True)[0] |
|
|
hyp=None, augment=False, cache=False, pad=0.5, rect=True)[0] |
|
|
|
|
|
|
|
|
seen = 0 |
|
|
seen = 0 |
|
|
names = model.names if hasattr(model, 'names') else model.module.names |
|
|
|
|
|
|
|
|
names = {k: v for k, v in enumerate(model.names if hasattr(model, 'names') else model.module.names)} |
|
|
coco91class = coco80_to_coco91_class() |
|
|
coco91class = coco80_to_coco91_class() |
|
|
s = ('%20s' + '%12s' * 6) % ('Class', 'Images', 'Targets', 'P', 'R', 'mAP@.5', 'mAP@.5:.95') |
|
|
s = ('%20s' + '%12s' * 6) % ('Class', 'Images', 'Targets', 'P', 'R', 'mAP@.5', 'mAP@.5:.95') |
|
|
p, r, f1, mp, mr, map50, map, t0, t1 = 0., 0., 0., 0., 0., 0., 0., 0., 0. |
|
|
p, r, f1, mp, mr, map50, map, t0, t1 = 0., 0., 0., 0., 0., 0., 0., 0., 0. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# W&B logging |
|
|
# W&B logging |
|
|
if len(wandb_images) < log_imgs: |
|
|
if len(wandb_images) < log_imgs: |
|
|
bbox_data = [{"position": {"minX": xyxy[0], "minY": xyxy[1], "maxX": xyxy[2], "maxY": xyxy[3]}, |
|
|
|
|
|
"class_id": int(cls), |
|
|
|
|
|
"scores": {"class_score": conf}, |
|
|
|
|
|
"domain": "pixel"} for *xyxy, conf, cls in pred.clone().tolist()] |
|
|
|
|
|
wandb_images.append(wandb.Image(img[si], boxes={"predictions": {"box_data": bbox_data}})) |
|
|
|
|
|
|
|
|
box_data = [{"position": {"minX": xyxy[0], "minY": xyxy[1], "maxX": xyxy[2], "maxY": xyxy[3]}, |
|
|
|
|
|
"class_id": int(cls), |
|
|
|
|
|
"box_caption": "%s %.3f" % (names[cls], conf), |
|
|
|
|
|
"scores": {"class_score": conf}, |
|
|
|
|
|
"domain": "pixel"} for *xyxy, conf, cls in pred.clone().tolist()] |
|
|
|
|
|
boxes = {"predictions": {"box_data": box_data, "class_labels": names}} |
|
|
|
|
|
wandb_images.append(wandb.Image(img[si], boxes=boxes)) |
|
|
|
|
|
|
|
|
# Clip boxes to image bounds |
|
|
# Clip boxes to image bounds |
|
|
clip_coords(pred, (height, width)) |
|
|
clip_coords(pred, (height, width)) |