...by deep copying results before passing to coco.
The results dictionary will be attached as 'annotations' to the dataset and will be changed,
making the use of the same structure impossible for the second time.
Previously the test would fail on second call to coco_api.loadRes() with an exception (KeyError: 'precision' when trying to calculate difference between API results).
Also, handle the case when one API produces an exception and the other one does not. Previously, the test code would ignore that and try to calculate the difference resulting in an error.
...by deep copying results before passing to coco. The results dictionary will be attached as 'annotations' to the dataset and will be changed, making the use of the same structure impossible for the second time.
Previously the test would fail on second call to
coco_api.loadRes()
with an exception (KeyError: 'precision'
when trying to calculate difference between API results).Also, handle the case when one API produces an exception and the other one does not. Previously, the test code would ignore that and try to calculate the difference resulting in an error.