Closed JaimyvS closed 3 months ago
Potentially solved by adding indent=4
to json.dump
in the methods in utils/post_process.py
, e.g. https://github.com/microsoft/CameraTraps/blob/e2196157658e8751d7c34e205aae22f09883de2b/PytorchWildlife/utils/post_process.py#L107C14-L107C18
Hello @JaimyvS , thank you very much for reporting! As @calebrob6 mentioned, it can be easily done but I would say rather than a bug, it is more of an enhancement. We will add indention to the output json in our next updates!
Hello @JaimyvS and @calebrob6, this issue is addressed with the newest commits! You can update the package through pip and test the new json output functions! Thank you very much again!
Search before asking
Bug
A small bug report, that might be better defined as a quality of life improvement.
Whenever I run a batch detection script with a JSON file as output. The JSON file is formatted into one single line.
E.g.:
{"annotations": [{"img_id": "./test_set/DSC_7607.JPG", "bbox": [[2078, 876, 3845, 3421], [1419, 1354, 1963, 2938], [3098, 1244, 3312, 1645]], "category": [0, 0, 1], "confidence": [0.8661148548126221, 0.582044243812561, 0.20031577348709106]},
Instead of:
Of course, this is easily done with online JSON beautifiers but with multiple files, having it directly as output would make it much easier to quickly look through the results.
Thanks!
Environment
Minimal Reproducible Example
No response
Additional
No response
Are you willing to submit a PR?