Exemplo n.º 1
0
 def pd_postprocess(self, inference):
     scores = np.array(inference.getLayerFp16("classificators"), dtype=np.float16) # 896
     bboxes = np.array(inference.getLayerFp16("regressors"), dtype=np.float16).reshape((self.nb_anchors,18)) # 896x18
     # Decode bboxes
     self.regions = mpu.decode_bboxes(self.pd_score_thresh, scores, bboxes, self.anchors)
     # Non maximum suppression
     self.regions = mpu.non_max_suppression(self.regions, self.pd_nms_thresh)
     if self.use_lm:
         mpu.detections_to_rect(self.regions)
         mpu.rect_transformation(self.regions, self.video_size, self.video_size)
    def pd_postprocess(self, inference):
        scores = np.squeeze(inference[self.pd_scores])  # 896
        bboxes = inference[self.pd_bboxes][0]  # 896x12
        # Decode bboxes
        self.regions = mpu.decode_bboxes(self.pd_score_thresh,
                                         scores,
                                         bboxes,
                                         self.anchors,
                                         best_only=not self.multi_detection)
        # Non maximum suppression (not needed if best_only is True)
        if self.multi_detection:
            self.regions = mpu.non_max_suppression(self.regions,
                                                   self.pd_nms_thresh)

        mpu.detections_to_rect(self.regions,
                               kp_pair=[0, 1] if self.full_body else [2, 3])
        mpu.rect_transformation(self.regions, self.frame_size, self.frame_size)
Exemplo n.º 3
0
    def pd_postprocess(self, inference):
        scores = np.array(inference.getLayerFp16("classificators"),
                          dtype=np.float16)  # 896
        bboxes = np.array(inference.getLayerFp16("regressors"),
                          dtype=np.float16).reshape(
                              (self.nb_anchors, 12))  # 896x12

        # Decode bboxes
        self.regions = mpu.decode_bboxes(self.pd_score_thresh,
                                         scores,
                                         bboxes,
                                         self.anchors,
                                         best_only=not self.multi_detection)
        # Non maximum suppression (not needed if best_only is True)
        if self.multi_detection:
            self.regions = mpu.non_max_suppression(self.regions,
                                                   self.pd_nms_thresh)

        mpu.detections_to_rect(self.regions,
                               kp_pair=[0, 1] if self.full_body else [2, 3])
        mpu.rect_transformation(self.regions, self.frame_size, self.frame_size)