未验证 提交 f17b971d 编写于 作者: W whs 提交者: GitHub

Make demo of slim support COCO dataset. (#33)

上级 576b06f8
...@@ -52,7 +52,7 @@ logging.basicConfig(level=logging.INFO, format=FORMAT) ...@@ -52,7 +52,7 @@ logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
def eval_run(exe, compile_program, reader, keys, values, cls, test_feed): def eval_run(exe, compile_program, reader, keys, values, cls, test_feed, cfg):
""" """
Run evaluation program, return program outputs. Run evaluation program, return program outputs.
""" """
...@@ -75,9 +75,16 @@ def eval_run(exe, compile_program, reader, keys, values, cls, test_feed): ...@@ -75,9 +75,16 @@ def eval_run(exe, compile_program, reader, keys, values, cls, test_feed):
feed=feed_data, feed=feed_data,
fetch_list=[values[0]], fetch_list=[values[0]],
return_numpy=False) return_numpy=False)
outs.append(data['gt_box'])
outs.append(data['gt_label']) if cfg.metric == 'VOC':
outs.append(data['is_difficult']) outs.append(data['gt_box'])
outs.append(data['gt_label'])
outs.append(data['is_difficult'])
elif cfg.metric == 'COCO':
outs.append(data['im_info'])
outs.append(data['im_id'])
outs.append(data['im_shape'])
res = { res = {
k: (np.array(v), v.recursive_sequence_lengths()) k: (np.array(v), v.recursive_sequence_lengths())
for k, v in zip(keys, outs) for k, v in zip(keys, outs)
...@@ -195,7 +202,7 @@ def main(): ...@@ -195,7 +202,7 @@ def main():
#place = fluid.CPUPlace() #place = fluid.CPUPlace()
#exe = fluid.Executor(place) #exe = fluid.Executor(place)
results = eval_run(exe, program, eval_reader, eval_keys, eval_values, results = eval_run(exe, program, eval_reader, eval_keys, eval_values,
eval_cls, test_data_feed) eval_cls, test_data_feed, cfg)
resolution = None resolution = None
if 'mask' in results[0]: if 'mask' in results[0]:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册