Skip to content

Commit

Permalink
Eliminar función sin usar [Close #2 Close #6 Close #7 Close #8]
Browse files Browse the repository at this point in the history
  • Loading branch information
modejota committed Jul 8, 2022
1 parent 00efaa0 commit 31fef1b
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions swimit/for_documentation/segmentation_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,3 @@ def f1score(gt_bbox, pred_bbox, smooth=1e-6):
union = gt_bbox[2] * gt_bbox[3] + pred_bbox[2] * pred_bbox[3]
dice = 2. * intersection / (union + smooth)
return dice


def yolobbox2bbox(data, dw=1292, dh=120):
_, x, y, w, h = map(float, data.split(' '))
left = int((x - w / 2) * dw)
right = int((x + w / 2) * dw)
top = int((y - h / 2) * dh)
bottom = int((y + h / 2) * dh)

if left < 0:
left = 0
if right > dw - 1:
right = dw - 1
if top < 0:
top = 0
if bottom > dh - 1:
bottom = dh - 1
return [left, top, abs(right - left), abs(bottom - top)]

0 comments on commit 31fef1b

Please sign in to comment.