Missing functionality of export_path in EvalConfig?
In models/object_detection/protos/eval.proto#L34, there is a field called export_path:
// Path to export detections to COCO compatible JSON format.
optional string export_path = 9 [default=''];
However, while trying to search how this field is being used, it seems there actually is no implementation of exporting detections to JSON format in the current repo: https://github.com/tensorflow/models/search?utf8=%E2%9C%93&q=export_path&type=
I've also tried to set up export_path in my EvalConfig but nothing seems to be happening so I'm guessing maybe this functionality right now is missing. Can someone help take a look?
Sorry @derekhh - we have not exposed this behavior yet and it currently doesn't do anything. Thanks for asking!
Thanks @jch1 for your reply. :)
Are there any updates on this? This would be very helpful!
Hi, this feature was available with the previous eval.py script but is no longer wired to the model_main.py manager. But the feature still exists in metrics/coco_evaluation.py, it is a method of the class you can call for instance line 216 in evaluate:
self.dump_detections_to_json_file("test.json")
You will also need to change utils/json_utils.py to avoid formatting problem. The function used is Dump, you can change two things:
First, define how to encode floats: (can be done globally, before the function definition also)
encoder.FLOAT_REPR = lambda o: format(o, '.%df' % 3)
and then you need to convert int objects to "true" ints for them to be serializable:
def convert(o):
return int(o)
json.dump(obj, fid, default=convert, indent=4)
instead of
json.dump(obj, fid, **params)
If you want to do things right, you can also bind this to the proto parameters :)
Hi, this feature was available with the previous eval.py script but is no longer wired to the model_main.py manager. But the feature still exists in
metrics/coco_evaluation.py, it is a method of the class you can call for instance line 216 inevaluate:self.dump_detections_to_json_file("test.json")You will also need to change
utils/json_utils.pyto avoid formatting problem. The function used is Dump, you can change two things:First, define how to encode floats: (can be done globally, before the function definition also)
encoder.FLOAT_REPR = lambda o: format(o, '.%df' % 3)and then you need to convert int objects to "true" ints for them to be serializable:
def convert(o): return int(o) json.dump(obj, fid, default=convert, indent=4)instead of
json.dump(obj, fid, **params)If you want to do things right, you can also bind this to the proto parameters :)
@aloisDeLaComble Hey how are you, I am struggling with this functionality. Could you please offer some help with this?