小编Alb*_*ert的帖子

为什么 NMSboxes 不消除多个边界框?

首先这里是我的代码:

        image = cv2.imread(filePath)
        height, width, channels = image.shape
        
        # USing blob function of opencv to preprocess image
        blob = cv2.dnn.blobFromImage(image, 1 / 255.0, (416, 416),
        swapRB=True, crop=False)
        #Detecting objects
        net.setInput(blob)
        outs = net.forward(output_layers)
        
        # Showing informations on the screen
        class_ids = []
        confidences = []
        boxes = []

        for out in outs:
            for detection in out:
                scores = detection[5:]
                class_id = np.argmax(scores)
                confidence = scores[class_id]
                if confidence > 0.7:
                    # Object detected
                    center_x = int(detection[0] * width)
                    center_y = …
Run Code Online (Sandbox Code Playgroud)

opencv object-detection python-3.x opencv-python yolo

2
推荐指数
1
解决办法
1388
查看次数