fix bug in coco dataset categories mapping (#809)
fix bug in coco dataset categories mapping (#809)

Summary:
The function `convert_to_coco_dict` doesn't currently take into account whether there is a `thing_dataset_id_to_contiguous_id` mapping in metadata, which is inconsistent with the behavior of `COCOEvaluator` when generating coco format predictions (uses `thing_dataset_id_to_contiguous_id` for category mapping)
Pull Request resolved: https://github.com/facebookresearch/detectron2/pull/809

Differential Revision: D19821104

Pulled By: ppwwyyxx

fbshipit-source-id: d4b2d6bdc46169cea3b1c90becc53b89ad01250d

facebookresearch/detectron2,facebookresearch/detectron2,facebookresearch/detectron2