From fef6192bcab37c1d5746ce6efd68f6942a0a18ef Mon Sep 17 00:00:00 2001 From: Ningxin Hu Date: Wed, 27 May 2020 16:20:07 +0800 Subject: [PATCH] Merge pull request #17394 from huningxin:fix_segmentation_py * Fix window title of python segmentation example * Fix float text position of python segmentation examples --- samples/dnn/mask_rcnn.py | 2 +- samples/dnn/segmentation.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/dnn/mask_rcnn.py b/samples/dnn/mask_rcnn.py index a67f19519e..352dfd191a 100644 --- a/samples/dnn/mask_rcnn.py +++ b/samples/dnn/mask_rcnn.py @@ -43,7 +43,7 @@ def showLegend(classes): for i in range(len(classes)): block = legend[i * blockHeight:(i + 1) * blockHeight] block[:,:] = colors[i] - cv.putText(block, classes[i], (0, blockHeight/2), cv.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255)) + cv.putText(block, classes[i], (0, blockHeight//2), cv.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255)) cv.namedWindow('Legend', cv.WINDOW_NORMAL) cv.imshow('Legend', legend) diff --git a/samples/dnn/segmentation.py b/samples/dnn/segmentation.py index a926ca27b3..1a228c63aa 100644 --- a/samples/dnn/segmentation.py +++ b/samples/dnn/segmentation.py @@ -65,7 +65,7 @@ def showLegend(classes): for i in range(len(classes)): block = legend[i * blockHeight:(i + 1) * blockHeight] block[:,:] = colors[i] - cv.putText(block, classes[i], (0, blockHeight/2), cv.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255)) + cv.putText(block, classes[i], (0, blockHeight//2), cv.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255)) cv.namedWindow('Legend', cv.WINDOW_NORMAL) cv.imshow('Legend', legend) @@ -76,7 +76,7 @@ net = cv.dnn.readNet(args.model, args.config, args.framework) net.setPreferableBackend(args.backend) net.setPreferableTarget(args.target) -winName = 'Deep learning image classification in OpenCV' +winName = 'Deep learning semantic segmentation in OpenCV' cv.namedWindow(winName, cv.WINDOW_NORMAL) cap = cv.VideoCapture(args.input if args.input else 0)