open-mmlab / mmrotate

OpenMMLab Rotated Object Detection Toolbox and Benchmark
https://mmrotate.readthedocs.io/en/latest/
Apache License 2.0
1.85k stars 546 forks source link

[Feature] support format-only on tools/test.py #823

Open yuvalgrossman opened 1 year ago

yuvalgrossman commented 1 year ago

What's the feature?

Hi, I need to run a model on some data (inference or test) and produce an output file in format of COCO json. I saw that in the main branch it is possible using the "--format-only" argument, however it does not exist in the 1.x branch (which I have to use because I need RTMDet), which only supports pickle output file. I saw a TODO in line 15 of tools/test.py referring to add support in that option. How come it is deprecated? I think of implementing it but I think maybe I'm missing something?

Also, as far as I know, in the COCO format there is not predefined attribute for rotated bounding box. There are two options I think of:

  1. add a custom attribute named "r_bbox" and decide on a specific rotated bbox format (oc/le135/le90)
  2. use the "segmentation" attribute for the 4 point polygon

either way I think the main "bbox" attribute should be occupied with the horizontal bbox.

will be glad for some direction here Yuval

Any other context?

No response

zytx121 commented 1 year ago

Hi @yuvalgrossman, in MMRotate, we don't support output JSON results now.

If you want to output the JSON results, you can try as follow: