Skip to content

Commit 86f97a8

Browse files
committed
[x1, y1, x2, y2] to coco format [x1, y1, w, h]
1 parent 224a52a commit 86f97a8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ A minimal PyTorch implementation of YOLOv4.
4040

4141
# 0. Weights Download
4242

43-
## 0.1 darknet
43+
## 0.1 darkent
4444
- baidu(https://pan.baidu.com/s/1dAGEW8cm-dqK14TbhhVetA Extraction code:dm5b)
4545
- google(https://drive.google.com/open?id=1cewMfusmPjYWbrnuJRuKhPMwRe_b9PaT)
4646

train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ def evaluate(model, data_loader, cfg, device, logger=None, **kwargs):
494494
img_height, img_width = img.shape[:2]
495495
# boxes = output[...,:4].copy() # output boxes in yolo format
496496
boxes = boxes.squeeze(2).cpu().detach().numpy()
497-
boxes[...,:2] = boxes[...,:2] - boxes[...,2:]/2 # to coco format
497+
boxes[...,2:] = boxes[...,2:] - boxes[...,:2] # Transform [x1, y1, x2, y2] to [x1, y1, w, h]
498498
boxes[...,0] = boxes[...,0]*img_width
499499
boxes[...,1] = boxes[...,1]*img_height
500500
boxes[...,2] = boxes[...,2]*img_width

0 commit comments

Comments
 (0)