• MindSpore: mindspore.dataset.CocoDataset返回的dataset的‘category_id’数据是一维向量还是标量


    问题描述:

    mindspore.dataset.CocoDataset返回的dataset的‘category_id’数据是一维向量还是标量

    解决方案:

    返回的是一个 N * 1二维数组 

    举例如下:

    假设annotations是如下:

    [{

    "segmentation": [

    [10.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0]

    ],

    "category_id": 1,

    "iscrowd": 0,

    "image_id": 391895,

    "bbox": [10, 10, 10, 10],

    "area": 100,

    "id": 10000

    }, {

    "segmentation": [

    [20.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0]

    ],

    "category_id": 2,

    "iscrowd": 0,

    "image_id": 318219,

    "bbox": [20, 20, 20, 20],

    "area": 400,

    "id": 10001

    }, {

    "segmentation": [

    [40.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0, 49.0, 40.0, 41.0, 42.0]

    ],

    "category_id": 3,

    "iscrowd": 0,

    "image_id": 554625,

    "bbox": [30, 30, 30, 30],

    "area": 900,

    "id": 10002

    }, {

    "segmentation": [

    [50.0, 52.0, 53.0, 54.0, 55.0, 56.0, 57.0, 58.0, 59.0, 60.0, 61.0, 62.0, 63.0]

    ],

    "category_id": 4,

    "iscrowd": 0,

    "image_id": 574769,

    "bbox": [40, 40, 40, 40],

    "area": 1600,

    "id": 10003

    }, {

    "segmentation": [

    [60.0, 62.0, 63.0, 64.0, 65.0, 66.0, 67.0, 68.0, 69.0, 70.0, 71.0, 72.0, 73.0, 74.0]

    ],

    "category_id": 5,

    "iscrowd": 0,

    "image_id": 60623,

    "bbox": [50, 50, 50, 50],

    "area": 2500,

    "id": 10004

    }, {

    "segmentation": [

    [60.0, 62.0, 63.0, 64.0, 65.0, 66.0, 67.0],

    [68.0, 69.0, 70.0, 71.0, 72.0, 73.0, 74.0]

    ],

    "category_id": 6,

    "iscrowd": 0,

    "image_id": 309022,

    "bbox": [60, 60, 60, 60],

    "area": 3600,

    "id": 10005

    }, {

    "segmentation": [

    [70.0, 72.0, 73.0, 74.0, 75.0]

    ],

    "category_id": 7,

    "iscrowd": 0,

    "image_id": 391895,

    "bbox": [70, 70, 70, 70],

    "area": 4900,

    "id": 10006

    }, {

    "segmentation": {

    "counts": [10.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0],

    "size": [200, 300]

    },

    "category_id": 8,

    "iscrowd": 1,

    "image_id": 318219,

    "bbox": [80, 80, 80, 80],

    "area": 6400,

    "id": 10007

    }]

    那边返回的 category_id 是如下:

    [[1] [7]],

    [[2] [8]],

    [[3]],

    [[4]],

    [[5]],

    [[6]]

  • 相关阅读:
    linux为所有用户安装conda
    sqlmap tamper脚本编写
    基于光栅波导结构的 R AR&MR 系统的 建模
    4.02 用户中心-上传头像功能开发
    遥控无人机出口美国亚马逊UL961的测试报告
    FANUC机器人_KAREL编程入门学习(1)
    经典卷积神经网络 - GoogLeNet
    Redis原理到常用语法基础图文讲解
    java计算机毕业设计火车订票管理系统源码+mysql数据库+系统+lw文档+部署
    Transformer模型 | iTransformer时序预测
  • 原文地址:https://blog.csdn.net/weixin_45666880/article/details/126022343