From ade57c8bd047977f604155381c495a16872d2748 Mon Sep 17 00:00:00 2001 From: Nobuo Tsukamoto Date: Fri, 31 Aug 2018 00:21:54 +0900 Subject: [PATCH] Fixed that object_detection.py does not work in python3. --- samples/dnn/object_detection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/dnn/object_detection.py b/samples/dnn/object_detection.py index 329c349e49..7063fd2abb 100644 --- a/samples/dnn/object_detection.py +++ b/samples/dnn/object_detection.py @@ -142,8 +142,8 @@ def postprocess(frame, outs): center_y = int(detection[1] * frameHeight) width = int(detection[2] * frameWidth) height = int(detection[3] * frameHeight) - left = center_x - width / 2 - top = center_y - height / 2 + left = int(center_x - width / 2) + top = int(center_y - height / 2) classIds.append(classId) confidences.append(float(confidence)) boxes.append([left, top, width, height]) -- GitLab