本文整理汇总了Python中config.config.config.CLASS_AGNOSTIC属性的典型用法代码示例。如果您正苦于以下问题:Python config.CLASS_AGNOSTIC属性的具体用法?Python config.CLASS_AGNOSTIC怎么用?Python config.CLASS_AGNOSTIC使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类config.config.config
的用法示例。
在下文中一共展示了config.CLASS_AGNOSTIC属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: process_pred_result
# 需要导入模块: from config.config import config [as 别名]
# 或者: from config.config.config import CLASS_AGNOSTIC [as 别名]
def process_pred_result(classes, pred_result, num_classes, thresh, cfg, nms, all_boxes, idx, max_per_image, vis, center_image, scales):
for delta, (scores, boxes, data_dict) in enumerate(pred_result):
for j in range(1,num_classes):
indexes = np.where(scores[:, j] > thresh)[0]
cls_scores = scores[indexes, j, np.newaxis]
cls_boxes = boxes[indexes, 4:8] if cfg.CLASS_AGNOSTIC else boxes[indexes, j * 4:(j + 1) * 4]
cls_dets = np.hstack((cls_boxes, cls_scores))
if cfg.TEST.SEQ_NMS:
all_boxes[j][idx+delta]=cls_dets
else:
cls_dets=np.float32(cls_dets)
keep = nms(cls_dets)
all_boxes[j][idx + delta] = cls_dets[keep, :]
if cfg.TEST.SEQ_NMS==False and max_per_image > 0:
image_scores = np.hstack([all_boxes[j][idx + delta][:, -1]
for j in range(1, num_classes)])
if len(image_scores) > max_per_image:
image_thresh = np.sort(image_scores)[-max_per_image]
for j in range(1, num_classes):
keep = np.where(all_boxes[j][idx + delta][:, -1] >= image_thresh)[0]
all_boxes[j][idx + delta] = all_boxes[j][idx + delta][keep, :]
boxes_this_image = [[]] + [all_boxes[j][idx + delta] for j in range(1, num_classes)]
out_im = draw_all_detection(center_image, boxes_this_image, classes, scales[delta], cfg)
return out_im
return 0
示例2: setUpClass
# 需要导入模块: from config.config import config [as 别名]
# 或者: from config.config.config import CLASS_AGNOSTIC [as 别名]
def setUpClass(cls):
cfg.CLASS_AGNOSTIC = False
cfg.TRAIN.BBOX_WEIGHTS = np.array([1.0, 1.0, 1.0, 1.0])