本文整理匯總了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])