【问题标题】:Transform mmdet Mask r-cnn result to coco dataset to extract the segmentation #mmdetection将 mmdet Mask r-cnn 结果转换为 coco 数据集以提取分割#mmdetection
【发布时间】:2021-06-12 02:31:06
【问题描述】:

我已经获得了一个训练有素的掩码 r-cnn 模型,其中包含 .pth 检查点文件和 .py 配置文件,并且我能够使用通用教程对视频执行对象分割。 https://mmdetection.readthedocs.io/en/latest/1_exist_data_model.html 我正在尝试将分段结果转换为 json 中的 coco 格式,以便将其插入到我的管道中。指定:我需要将推理检测器的结果转换为 coco 格式的 json 文件。来自 mmdetection github repo 的 demo/video_demo 的代码:

结果将是:

我在这里找到了一个可能的解决方案:https://mmdetection.readthedocs.io/en/latest/api.html#module-mmdet.datasets。 results2json 函数会将分割结果(+ bbox 等)转储到 coco json 文件中,但我应该制作 CocoDataset 的实例以使用此函数。我没有带注释的 json 文件,更不用说管道了? (检查参数以创建一个)。

如何仍然使用分割的结果生成 coco 格式的 json 文件? 提前致谢。

【问题讨论】:

    标签: python mask image-segmentation faster-rcnn


    【解决方案1】:

    您可以通过以下方式轻松构建数据集

    dataset = build_dataset(cfg.data.test) 
    

    在构建 cfg 时,您可以插入测试管道和配置的工作方式。

    检查here以获取cfg.data.test中的内容

    那么就可以使用dataset.result2json(result)来获取json格式的注解了。

    【讨论】:

      猜你喜欢
      • 2020-07-27
      • 2022-10-20
      • 2018-09-15
      • 2021-09-15
      • 1970-01-01
      • 1970-01-01
      • 2022-12-25
      • 2020-07-28
      • 2020-02-03
      相关资源
      最近更新 更多