本文整理汇总了Python中dataset.Dataset.load_annotations方法的典型用法代码示例。如果您正苦于以下问题:Python Dataset.load_annotations方法的具体用法?Python Dataset.load_annotations怎么用?Python Dataset.load_annotations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dataset.Dataset
的用法示例。
在下文中一共展示了Dataset.load_annotations方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: open
# 需要导入模块: from dataset import Dataset [as 别名]
# 或者: from dataset.Dataset import load_annotations [as 别名]
if not os.path.exists(params["1st_stage_weights_fn"]):
print "The weights for the first stage does not exist!"
sys.exit(2)
w_1st = np.genfromtxt(params["1st_stage_weights_fn"], delimiter=",").astype(np.float32)
if not os.path.exists(params["sizes_indeces_fn"]):
print "The sizes indices file does not exist!"
sys.exit(2)
sizes = np.genfromtxt(params["sizes_indeces_fn"], delimiter=",").astype(np.int32)
if not os.path.exists(params["2nd_stage_weights_fn"]):
print "The weights for the second stage does not exist!"
sys.exit(2)
f = open(params["2nd_stage_weights_fn"])
w_str = f.read()
f.close()
w_2nd = json.loads(w_str)
ds = Dataset(basepath = basepath, training_set_fn = training_set_fn, test_set_fn = test_set_fn, annotations_path = annotations_path, images_path = images_path)
test_annotations = ds.load_annotations( mode = Dataset.TEST )
print "Evaluating recall..."
eval_recall = EvaluateRecall(w_1st = w_1st,
sizes_idx = sizes,
w_2nd = w_2nd,
num_bbs_per_size_1st_stage = params["num_win_psz"],
num_bbs_final = params["num_bbs"])
recall = eval_recall.evaluate_test_set(test_annotations)
print "Recall obetained with {0} windows per size index and {1} total final windows: {2:.5f}".format(params["num_win_psz"],params["num_bbs"],recall)