From a7fc85270fa1cb34afdc2da1f17fe17f6798e5a1 Mon Sep 17 00:00:00 2001 From: Garry Lam Date: Wed, 25 Apr 2018 21:23:04 +0800 Subject: [PATCH] fix issue #267 (YOLO output becomes all zero) --- libs/yolo_io.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/yolo_io.py b/libs/yolo_io.py index f585af08..dcd4a083 100644 --- a/libs/yolo_io.py +++ b/libs/yolo_io.py @@ -33,11 +33,11 @@ class YOLOWriter: ymin = box['ymin'] ymax = box['ymax'] - xcen = (xmin + xmax) / 2 / self.imgSize[1] - ycen = (ymin + ymax) / 2 / self.imgSize[0] + xcen = float((xmin + xmax)) / 2 / self.imgSize[1] + ycen = float((ymin + ymax)) / 2 / self.imgSize[0] - w = (xmax - xmin) / self.imgSize[1] - h = (ymax - ymin) / self.imgSize[0] + w = float((xmax - xmin)) / self.imgSize[1] + h = float((ymax - ymin)) / self.imgSize[0] classIndex = classList.index(box['name'])