def detected_bboxes(self, predictions, localisations, #通过SSD网络,得到检测到的bbox select_threshold=None, nms_threshold=0.5, clipping_bbox=None, top_k=400, keep_top_k=200): """Get the detected bounding boxes from the SSD network output. """ # Select top_k bboxes from predictions, and clip #选取top_k=400个框,并对框做修建(超出原图尺寸范围的切掉) rscores, rbboxes = \ #得到对应某个类别的得分值以及bbox ssd_common.tf_ssd_bboxes_select(predictions, localisations, select_threshold=select_threshold, num_classes=self.params.num_classes)
def detected_bboxes(self, predictions, localisations, select_threshold=None, nms_threshold=0.5, clipping_bbox=None, top_k=400, keep_top_k=200): """Get the detected bounding boxes from the SSD network output. """ # Select top_k bboxes from predictions, and clip rscores, rbboxes = \ ssd_common.tf_ssd_bboxes_select(predictions, localisations, select_threshold=select_threshold, num_classes=self.params.num_classes) rscores, rbboxes = \ tfe.bboxes_sort(rscores, rbboxes, top_k=top_k) # Apply NMS algorithm. rscores, rbboxes = \ tfe.bboxes_nms_batch(rscores, rbboxes, nms_threshold=nms_threshold, keep_top_k=keep_top_k) # if clipping_bbox is not None: # rbboxes = tfe.bboxes_clip(clipping_bbox, rbboxes) return rscores, rbboxes
def detected_bboxes( self, predictions, localisations, #通过SSD网络,得到检测到的bbox select_threshold=None, nms_threshold=0.5, clipping_bbox=None, top_k=400, keep_top_k=200): """Get the detected bounding boxes from the SSD network output. """ # Select top_k bboxes from predictions, and clip #选取top_k=400个框,并对框做修建(超出原图尺寸范围的切掉) # 得到对应某个类别的得分值以及bbox rscores, rbboxes = \ ssd_common.tf_ssd_bboxes_select(predictions, localisations, select_threshold=select_threshold, num_classes=self.params.num_classes) # 按照得分高低,筛选出400个bbox和对应得分 rscores, rbboxes = \ tfe.bboxes_sort(rscores, rbboxes, top_k=top_k) # Apply NMS algorithm. #应用非极大值抑制,筛选掉与得分最高bbox重叠率大于0.5的,保留200个 rscores, rbboxes = \ tfe.bboxes_nms_batch(rscores, rbboxes, nms_threshold=nms_threshold, keep_top_k=keep_top_k) if clipping_bbox is not None: rbboxes = tfe.bboxes_clip(clipping_bbox, rbboxes) return rscores, rbboxes #返回裁剪好的bbox和对应得分
def detected_bboxes(self, predictions, localisations, select_threshold=None, nms_threshold=0.5, clipping_bbox=None, top_k=400, keep_top_k=200): """Get the detected bounding boxes from the SSD network output. """ # Select top_k bboxes from predictions, and clip rscores, rbboxes = \ ssd_common.tf_ssd_bboxes_select(predictions, localisations, select_threshold=select_threshold, num_classes=self.params.num_classes) rscores, rbboxes = \ tfe.bboxes_sort(rscores, rbboxes, top_k=top_k) # Apply NMS algorithm. rscores, rbboxes = \ tfe.bboxes_nms_batch(rscores, rbboxes, nms_threshold=nms_threshold, keep_top_k=keep_top_k) # if clipping_bbox is not None: # rbboxes = tfe.bboxes_clip(clipping_bbox, rbboxes) return rscores, rbboxes