简体   繁体   English

如何将检测到的对象转换为COCO数据集Json

[英]How to Convert Detected Object to COCO dataset Json

I follow Object Detection Demo in https://github.com/tensorflow/models/blob/master/research/object_detection/object_detection_tutorial.ipynb : 我在https://github.com/tensorflow/models/blob/master/research/object_detection/object_detection_tutorial.ipynb中遵循对象检测演示:

# Actual detection.
output_dict = run_inference_for_single_image(image_np, detection_graph) 

But I want to convert output_dict (output from function run_inference_for_single_image(image_np, detection_graph)) to COCO annotation JSON type so I can input it to make benchmark between different Object Detection models. 但是我想将output_dict(从功能run_inference_for_single_image(image_np,detection_graph)的输出)转换为COCO注释JSON类型,以便我可以输入它以在不同的对象检测模型之间进行基准测试。

Here is code to benchmark model: https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pycocoEvalDemo.ipynb 这是基准模型的代码: 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)

But you need to input a COCO Json type. 但是您需要输入一个COCO Json类型。

Are there anyone can tell me how to Convert from output_dict to COCO Json? 有谁能告诉我如何从output_dict转换为COCO Json?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM