【发布时间】:2019-02-26 01:20:30
【问题描述】:
# Actual detection.
output_dict = run_inference_for_single_image(image_np, detection_graph)
但我想将 output_dict(函数 run_inference_for_single_image(image_np, detection_graph) 的输出)转换为 COCO 注释 JSON 类型,以便我可以输入它以在不同的对象检测模型之间进行基准测试。
这是基准模型的代码:https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pycocoEvalDemo.ipynb
#initialize COCO detections api
resFile='%s/results/%s_%s_fake%s100_results.json'
resFile = resFile%(dataDir, prefix, dataType, annType)
cocoDt=cocoGt.loadRes(resFile)
但是你需要输入一个COCO Json类型。
有人可以告诉我如何从 output_dict 转换为 COCO Json 吗?
【问题讨论】:
-
我也在寻找解决方案。你成功了吗?
标签: json python-3.x tensorflow object-detection-api