YOLOX icon indicating copy to clipboard operation
YOLOX copied to clipboard

Fix: Preserve 'info' field in COCO-style annotations for compatibility with pycocotools >= 2.0.9

Open apoupon opened this issue 5 months ago • 5 comments
trafficstars

Since the release of pycocotools version 2.0.9, the loadRes function now requires the 'info' field to be present in the result file. If missing, using COCOEvaluator.evaluate_prediction raises a KeyError: 'info'.

This PR updates the preprocessing step to preserve the 'info' field instead of discarding it, ensuring compatibility with recent versions of pycocotools

PS: this fix is minimal and untested locally but aligns with upstream changes in pycocotools 2.0.9

apoupon avatar Jun 07 '25 11:06 apoupon

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jun 07 '25 11:06 CLAassistant

downgrade the pycocotools to 2.0.0

mwaseemrandhawa avatar Jun 10 '25 15:06 mwaseemrandhawa

downgrade the pycocotools to 2.0.0

yes that works as a quick fix, I'm just suggesting a long-term fix to stay aligned with pycocotools

apoupon avatar Jun 10 '25 17:06 apoupon

For me, version 2.0.8 worked

luicalrob avatar Jun 11 '25 06:06 luicalrob

Since the release of pycocotools version 2.0.9, the loadRes function now requires the 'info' field to be present in the result file. If missing, using COCOEvaluator.evaluate_prediction raises a KeyError: 'info'.

This PR updates the preprocessing step to preserve the 'info' field instead of discarding it, ensuring compatibility with recent versions of pycocotools

PS: this fix is minimal and untested locally but aligns with upstream changes in pycocotools 2.0.9

Does this only happened in Evaluator? Using pop here could help users to save memory

FateScript avatar Jun 13 '25 03:06 FateScript

Since the release of pycocotools version 2.0.9, the loadRes function now requires the 'info' field to be present in the result file. If missing, using COCOEvaluator.evaluate_prediction raises a KeyError: 'info'. This PR updates the preprocessing step to preserve the 'info' field instead of discarding it, ensuring compatibility with recent versions of pycocotools PS: this fix is minimal and untested locally but aligns with upstream changes in pycocotools 2.0.9

Does this only happened in Evaluator? Using pop here could help users to save memory

Yes, only in Evaluator !

if you think saving memory is crucial here maybe we can just update requirements.txt with version < 2.0.9

apoupon avatar Jun 29 '25 09:06 apoupon

Since the release of pycocotools version 2.0.9, the loadRes function now requires the 'info' field to be present in the result file. If missing, using COCOEvaluator.evaluate_prediction raises a KeyError: 'info'. This PR updates the preprocessing step to preserve the 'info' field instead of discarding it, ensuring compatibility with recent versions of pycocotools PS: this fix is minimal and untested locally but aligns with upstream changes in pycocotools 2.0.9

Does this only happened in Evaluator? Using pop here could help users to save memory

Yes, only in Evaluator !

if you think saving memory is crucial here maybe we can just update requirements.txt with version < 2.0.9

Could you check if it's in eval mode, if so, don't pop, else pop?

FateScript avatar Jul 31 '25 07:07 FateScript