Python将COCO格式实例分割数据集转换为YOLO格式实例分割数据集

news2024/11/16 21:24:00

Python将COCO格式实例分割数据集转换为YOLO格式实例分割数据集

  • 前言
  • 相关介绍
    • COCO格式实例分割数据集转换为YOLO格式实例分割数据集
    • coco格式对应的json文件,以test.json为例
    • 格式转换代码,内容如下

前言

  • 由于本人水平有限,难免出现错漏,敬请批评改正。
  • 更多精彩内容,可点击进入YOLO系列专栏或我的个人主页查看
  • YOLOv5:添加SE、CBAM、CoordAtt、ECA注意力机制
  • YOLOv5:yolov5s.yaml配置文件解读、增加小目标检测层
  • YOLOv5:IoU、GIoU、DIoU、CIoU、EIoU
  • YOLOv7训练自己的数据集(口罩检测)
  • YOLOv8训练自己的数据集(足球检测)
  • 玩转Jetson Nano(五):TensorRT加速YOLOv5目标检测

相关介绍

  • Python是一种跨平台的计算机程序设计语言。是一个高层次的结合了解释性、编译性、互动性和面向对象的脚本语言。最初被设计用于编写自动化脚本(shell),随着版本的不断更新和语言新功能的添加,越多被用于独立的、大型项目的开发。
  • PyTorch 是一个深度学习框架,封装好了很多网络和深度学习相关的工具方便我们调用,而不用我们一个个去单独写了。它分为 CPU 和 GPU 版本,其他框架还有 TensorFlow、Caffe 等。PyTorch 是由 Facebook 人工智能研究院(FAIR)基于 Torch 推出的,它是一个基于 Python 的可续计算包,提供两个高级功能:1、具有强大的 GPU 加速的张量计算(如 NumPy);2、构建深度神经网络时的自动微分机制。
    在这里插入图片描述

COCO格式实例分割数据集转换为YOLO格式实例分割数据集

coco格式对应的json文件,以test.json为例

{
    "annotations": [
        {
            "id": 2094,
            "iscrowd": 0,
            "image_id": 173,
            "category_id": 1,
            "segmentation": [
                [
                    1113,
                    777,
                    1115,
                    785,
                    1118,
                    784,
                    1120,
                    786,
                    1120,
                    792,
                    1118,
                    796,
                    1117,
                    801,
                    1117,
                    868,
                    1118,
                    875,
                    1120,
                    880,
                    1124,
                    882,
                    1138,
                    882,
                    1146,
                    884,
                    1153,
                    899,
                    1157,
                    901,
                    1166,
                    901,
                    1176,
                    899,
                    1178,
                    897,
                    1185,
                    888,
                    1204,
                    887,
                    1217,
                    884,
                    1291,
                    886,
                    1299,
                    885,
                    1302,
                    883,
                    1312,
                    883,
                    1323,
                    890,
                    1325,
                    899,
                    1332,
                    905,
                    1353,
                    905,
                    1360,
                    895,
                    1362,
                    885,
                    1364,
                    863,
                    1364,
                    833,
                    1359,
                    797,
                    1351,
                    774,
                    1326,
                    735,
                    1313,
                    726,
                    1297,
                    722,
                    1198,
                    720,
                    1191,
                    716,
                    1186,
                    718,
                    1177,
                    718,
                    1155,
                    732,
                    1150,
                    736,
                    1145,
                    745,
                    1145,
                    747,
                    1140,
                    755,
                    1135,
                    769,
                    1124,
                    776,
                    1121,
                    776,
                    1119,
                    774
                ]
            ],
            "area": 38102,
            "bbox": [
                1113,
                716,
                251,
                189
            ]
        },
        {
            "id": 577,
            "iscrowd": 0,
            "image_id": 43,
            "category_id": 3,
            "segmentation": [
                [
                    950,
                    795,
                    954,
                    803,
                    960,
                    803,
                    961,
                    802,
                    963,
                    801,
                    959,
                    796,
                    957,
                    794,
                    952,
                    794
                ]
            ],
            "area": 76.5,
            "bbox": [
                950,
                794,
                13,
                9
            ]
        },
        {
            "id": 606,
            "iscrowd": 0,
            "image_id": 43,
            "category_id": 3,
            "segmentation": [
                [
                    632,
                    782,
                    628,
                    780,
                    619,
                    780,
                    607,
                    785,
                    601,
                    785,
                    597,
                    786,
                    596,
                    787,
                    594,
                    787,
                    591,
                    790,
                    588,
                    791,
                    581,
                    791,
                    569,
                    797,
                    558,
                    799,
                    552,
                    803,
                    541,
                    804,
                    523,
                    809,
                    515,
                    812,
                    510,
                    815,
                    501,
                    816,
                    495,
                    820,
                    485,
                    821,
                    476,
                    825,
                    470,
                    827,
                    459,
                    829,
                    456,
                    832,
                    447,
                    833,
                    435,
                    840,
                    427,
                    840,
                    420,
                    842,
                    418,
                    844,
                    403,
                    847,
                    398,
                    850,
                    390,
                    851,
                    373,
                    857,
                    368,
                    857,
                    356,
                    862,
                    345,
                    864,
                    327,
                    869,
                    315,
                    874,
                    307,
                    875,
                    297,
                    881,
                    300,
                    883,
                    310,
                    883,
                    318,
                    881,
                    321,
                    879,
                    336,
                    876,
                    341,
                    873,
                    381,
                    860,
                    388,
                    859,
                    410,
                    852,
                    421,
                    847,
                    427,
                    847,
                    434,
                    843,
                    451,
                    838,
                    453,
                    836,
                    460,
                    834,
                    467,
                    834,
                    472,
                    831,
                    492,
                    826,
                    500,
                    822,
                    514,
                    818,
                    524,
                    817,
                    536,
                    811,
                    544,
                    810,
                    550,
                    808,
                    556,
                    804,
                    579,
                    797,
                    583,
                    797,
                    594,
                    792,
                    601,
                    792,
                    609,
                    788,
                    622,
                    786
                ]
            ],
            "area": 1939,
            "bbox": [
                297,
                780,
                335,
                103
            ]
        }
    ],
    "images": [
        {
            "id": 762,
            "width": 1920,
            "height": 1080,
            "file_name": "0762.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 179,
            "width": 1920,
            "height": 1080,
            "file_name": "0179.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 13,
            "width": 1920,
            "height": 1080,
            "file_name": "0013.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1871,
            "width": 1920,
            "height": 1080,
            "file_name": "1871.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 396,
            "width": 1920,
            "height": 1080,
            "file_name": "0396.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1762,
            "width": 1920,
            "height": 1080,
            "file_name": "1762.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 89,
            "width": 1920,
            "height": 1080,
            "file_name": "0089.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 2198,
            "width": 1920,
            "height": 1080,
            "file_name": "2198.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 262,
            "width": 1920,
            "height": 1080,
            "file_name": "0262.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1132,
            "width": 1920,
            "height": 1080,
            "file_name": "1099.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 929,
            "width": 1920,
            "height": 1080,
            "file_name": "0929.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1396,
            "width": 1920,
            "height": 1080,
            "file_name": "1318.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 2208,
            "width": 1920,
            "height": 1080,
            "file_name": "2208.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1248,
            "width": 1920,
            "height": 1080,
            "file_name": "1248.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1909,
            "width": 1920,
            "height": 1080,
            "file_name": "1909.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1487,
            "width": 1920,
            "height": 1080,
            "file_name": "1492.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 341,
            "width": 1920,
            "height": 1080,
            "file_name": "0341.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1851,
            "width": 1920,
            "height": 1080,
            "file_name": "1851.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1742,
            "width": 1920,
            "height": 1080,
            "file_name": "1742.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1957,
            "width": 1920,
            "height": 1080,
            "file_name": "1957.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1418,
            "width": 1920,
            "height": 1080,
            "file_name": "1418.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1592,
            "width": 1920,
            "height": 1080,
            "file_name": "1592.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 19,
            "width": 1920,
            "height": 1080,
            "file_name": "0019.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 579,
            "width": 1920,
            "height": 1080,
            "file_name": "0579.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1407,
            "width": 1920,
            "height": 1080,
            "file_name": "1372.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1975,
            "width": 1920,
            "height": 1080,
            "file_name": "1975.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 931,
            "width": 1920,
            "height": 1080,
            "file_name": "0931.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1977,
            "width": 1920,
            "height": 1080,
            "file_name": "1977.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 40,
            "width": 1920,
            "height": 1080,
            "file_name": "0040.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1366,
            "width": 1920,
            "height": 1080,
            "file_name": "1403.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 889,
            "width": 1920,
            "height": 1080,
            "file_name": "0889.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1050,
            "width": 1920,
            "height": 1080,
            "file_name": "1050.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 669,
            "width": 1920,
            "height": 1080,
            "file_name": "0669.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 2216,
            "width": 1920,
            "height": 1080,
            "file_name": "2216.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 659,
            "width": 1920,
            "height": 1080,
            "file_name": "0659.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 294,
            "width": 1920,
            "height": 1080,
            "file_name": "0294.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1895,
            "width": 1920,
            "height": 1080,
            "file_name": "1895.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 706,
            "width": 1920,
            "height": 1080,
            "file_name": "0710.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1273,
            "width": 1920,
            "height": 1080,
            "file_name": "1273.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 461,
            "width": 1920,
            "height": 1080,
            "file_name": "0461.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1023,
            "width": 1920,
            "height": 1080,
            "file_name": "1023.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1594,
            "width": 1920,
            "height": 1080,
            "file_name": "1594.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1747,
            "width": 1920,
            "height": 1080,
            "file_name": "1747.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1854,
            "width": 1920,
            "height": 1080,
            "file_name": "1854.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 750,
            "width": 1920,
            "height": 1080,
            "file_name": "0750.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1580,
            "width": 1920,
            "height": 1080,
            "file_name": "1580.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1735,
            "width": 1920,
            "height": 1080,
            "file_name": "1735.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1504,
            "width": 1920,
            "height": 1080,
            "file_name": "1509.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1630,
            "width": 1920,
            "height": 1080,
            "file_name": "1630.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 629,
            "width": 1920,
            "height": 1080,
            "file_name": "0629.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 367,
            "width": 1920,
            "height": 1080,
            "file_name": "0367.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1833,
            "width": 1920,
            "height": 1080,
            "file_name": "1833.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 583,
            "width": 1920,
            "height": 1080,
            "file_name": "0583.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 178,
            "width": 1920,
            "height": 1080,
            "file_name": "0178.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 199,
            "width": 1920,
            "height": 1080,
            "file_name": "0199.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1836,
            "width": 1920,
            "height": 1080,
            "file_name": "1836.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1636,
            "width": 1920,
            "height": 1080,
            "file_name": "1636.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 382,
            "width": 1920,
            "height": 1080,
            "file_name": "0382.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 421,
            "width": 1920,
            "height": 1080,
            "file_name": "0421.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1296,
            "width": 1920,
            "height": 1080,
            "file_name": "1328.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 2054,
            "width": 1920,
            "height": 1080,
            "file_name": "2054.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1072,
            "width": 1920,
            "height": 1080,
            "file_name": "1095.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 601,
            "width": 1920,
            "height": 1080,
            "file_name": "0601.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1313,
            "width": 1920,
            "height": 1080,
            "file_name": "1345.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 726,
            "width": 1920,
            "height": 1080,
            "file_name": "0704.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 924,
            "width": 1920,
            "height": 1080,
            "file_name": "0924.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 139,
            "width": 1920,
            "height": 1080,
            "file_name": "0139.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 445,
            "width": 1920,
            "height": 1080,
            "file_name": "0445.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1436,
            "width": 1920,
            "height": 1080,
            "file_name": "1441.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 1835,
            "width": 1920,
            "height": 1080,
            "file_name": "1835.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 311,
            "width": 1920,
            "height": 1080,
            "file_name": "0311.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        
        {
            "id": 173,
            "width": 1920,
            "height": 1080,
            "file_name": "0173.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        },
        {
            "id": 43,
            "width": 1920,
            "height": 1080,
            "file_name": "0043.jpg",
            "license": "",
            "flickr_url": "",
            "coco_url": "",
            "date_captured": ""
        }
    ],
    "categories": [
        {
            "id": 1,
            "name": "car",
            "color": [
                52,
                101,
                164
            ],
            "supercategory": ""
        },
        {
            "id": 2,
            "name": "traffic_sign",
            "color": [
                245,
                128,
                6
            ],
            "supercategory": ""
        },
        {
            "id": 3,
            "name": "lane_lines",
            "color": [
                115,
                210,
                22
            ],
            "supercategory": ""
        },
        {
            "id": 4,
            "name": "person",
            "color": [
                239,
                41,
                41
            ],
            "supercategory": ""
        },
        {
            "id": 5,
            "name": "motorcyclist",
            "color": [
                145,
                104,
                190
            ],
            "supercategory": ""
        },
        {
            "id": 6,
            "name": "cyclist",
            "color": [
                239,
                41,
                41
            ],
            "supercategory": ""
        }
    ]
}

格式转换代码,内容如下

import os
import json
import shutil

def write_yolo_txt_file(txt_file_path,label_seg_x_y_list):
    if not os.path.exists(txt_file_path):
        with open(txt_file_path, "w") as file:
            for element in label_seg_x_y_list:
                file.write(str(element) + " ")
            file.write('\n')
    else:
        with open(txt_file_path, "a") as file:
            for element in label_seg_x_y_list:
                file.write(str(element) + " ")
            file.write('\n')

def read_json(in_json_path,img_dir,target_dir):
    with open(in_json_path, "r", encoding='utf-8') as f:
        # json.load数据到变量json_data
        json_data = json.load(f) 

    # print(len(json_data['annotations']))
    # print(len(json_data['images']))
    # print(len(json_data['categories']))

    for annotation in json_data['annotations']: # 遍历标注数据信息
        # print(annotation)
        category_id = annotation['category_id']
        image_id = annotation['image_id']
        for image in json_data['images']: # 遍历图片相关信息
            if image['id'] == image_id:
                width = image['width'] # 图片宽
                height = image['height'] # 图片高
                img_file_name = image['file_name'] # 图片名称
                txt_file_name = image['file_name'].split('.')[0] + '.txt' # 要保存的对应txt文件名
                break
        # print(width,height,img_file_name,txt_file_name)
        segmentation = annotation['segmentation'] # 图像分割点信息[[x1,y1,x2,y2,...,xn,yn]]
        seg_x_y_list = [i/width if num%2==0 else i/height for num,i in enumerate(segmentation[0])] # 归一化图像分割点信息
        label_seg_x_y_list = seg_x_y_list[:]
        label_seg_x_y_list.insert(0,category_id) # 图像类别与分割点信息[label,x1,y1,x2,y2,...,xn,yn]
        # print(label_seg_x_y_list)

        # 写txt文件
        txt_file_path = target_dir + txt_file_name
        # print(txt_file_path)
        write_yolo_txt_file(txt_file_path,label_seg_x_y_list)

        # 选出txt对应img文件
        img_file_path = img_dir + img_file_name
        # print(img_file_path)
        shutil.copy(img_file_path,target_dir)



if __name__=="__main__":
    img_dir = 'JPEGImages/'
    target_dir = 'testset/'
    if not os.path.exists(target_dir):
        os.mkdir(target_dir)
    in_json_path = './test.json'
    read_json(in_json_path,img_dir,target_dir)

在这里插入图片描述在这里插入图片描述

  • 由于本人水平有限,难免出现错漏,敬请批评改正。
  • 更多精彩内容,可点击进入YOLO系列专栏或我的个人主页查看
  • YOLOv5:添加SE、CBAM、CoordAtt、ECA注意力机制
  • YOLOv5:yolov5s.yaml配置文件解读、增加小目标检测层
  • YOLOv5:IoU、GIoU、DIoU、CIoU、EIoU
  • YOLOv7训练自己的数据集(口罩检测)
  • YOLOv8训练自己的数据集(足球检测)
  • 玩转Jetson Nano(五):TensorRT加速YOLOv5目标检测

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/804686.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

MySQL基础(五)主从复制及读写分离

目录 前言 一、概述 (一)、MySQL Replication (二)、MySQL复制类型 (三)、MySQL支持的复制方式 二、部署MySQL主从异步复制 (一)、master(主) &#x…

一起来学shiny把(3)—-添加控件

什么是shiny?Shiny是一个R包,可让您轻松地直接从 R 构建交互式 Web 应用程序(应用程序)。本系列是个长教程,带你由浅入深学习shiny。 上一节我们在文章《R语言系列教程—–一起来学shiny吧(2)》…

【C++11】——右值引用、移动语义

目录 1. 基本概念 1.1 左值与左值引用 1.2 右值和右值引用 1.3 左值引用与右值引用 2. 右值引用实用场景和意义 2.1 左值引用的使用场景 2.2 左值引用的短板 2.3 右值引用和移动语义 2.3.1 移动构造 2.3.2 移动赋值 2.3.3 编译器做的优化 2.3.4 总结 2.4 右值引用…

开源盛行:为什么学习国产达梦数据库?

开源盛行:为什么学习国产达梦数据库? 武汉达梦数据库股份有限公司成立于2000年,是国内领先的数据库产品开发服务商,国内数据库基础软件产业发展的关键推动者。公司为客户提供各类数据库软件及集群软件、云计算与大数据等一系列数据…

【数据结构】·顺序表函数实现·赶紧学起来呀

💐 🌸 🌷 🍀 🌹 🌻 🌺 🍁 🍃 🍂 🌿 🍄🍝 🍛 🍤 📃个人主页 :阿然成长日记 …

element-ui使用动态渲染下拉选择框el-select已经选择的下拉框的值不可以重复选择让其disabled

调接口拿到下拉框数据的数据的时候将其disabled全为true 但是如果编辑的时候就需要与详情接口对比,如果有id一致就将disabled为true if (res.code 0) {if (this.dialogtitle "新增合同") {res.data.map((v) > {v.nameUnitVoList.forEach((item) >…

九耶:产品经理面试题 ——请说说工作中你主导的产品上线后你会关注哪些数据指标?

【面试官考察的点】 实际的产品工作中需要通过数据驱动业务:产品经理了解用户对不同功能的使用情况,行为特征和使用反馈,这样可以为产品的改进提供很好的方向。面试官想考察你是否具备数据分析的意识和能力。 【满分回答】 在产品上线后&am…

百度开发者平台API地理编码,根据地址获取经纬度

地理编码 | 百度地图API SDK (baidu.com) 原始csv # encoding:utf-8 import requests import csv import json # 接口地址 url "https://api.map.baidu.com/geocoding/v3"# 此处填写你在控制台-应用管理-创建应用后获取的AK ak "XXXXXXX"# 创建CSV文件并…

vue 实现拖拽效果

实现方式:使用自定义指令可以实现多个面板拖拽互不影响 1.自定义指令 js directives: {// 拖拽drag(el) {el.onmousedown function (e) {let x e.pageX - el.offsetLeftlet y e.pageY - el.offsetTopdocument.onmousemove function (e) {el.style.left e.pag…

掌握Python的X篇_12_如何使用VS Code调试Python程序

本篇将会介绍如何使用VS Code调试Python程序。 文章目录 1. 什么是调试2. 断点3. 如何启动调试4. 监视窗口5. 单步 1. 什么是调试 我们可以利用VS Code对Python代码进行调试。所谓调试,大家可以理解成有能力将程序进行 “慢动作播放”让我们有机会看到程序一步一步…

一文2500字详解如何使用mock.js实现接口测试的自动化

这篇文章主要为大家介绍了如何使用mock.js实现接口测试的自动化详解,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪 Mock.js 基础用法介绍 Mock.js是一个常用于生成随机数据和拦截Ajax请求的JavaScr…

linux基础学习

1.day1 1、修改虚拟机的网络; sudo vim /etc/netplan/*.yaml sudo netplan apply 2.day2 1、VIM配置; 2、安装SSH,调用putty接入终端; 3、shell命令; *:匹配任意长度的字符 ?:匹…

关于前端框架vue2升级为vue3的相关说明

一些框架需要升级 当前(202306) Vue 的最新稳定版本是 v3.3.4。Vue 框架升级为最新的3.0版本,涉及的相关依赖变更有: 前提条件:已安装 16.0 或更高版本的Node.js(摘) 必须的变更:核…

CAN总线开发必看! 如何使用CANlib检测CAN帧溢出情况? Kvaser三招帮你轻松解决

从1980年代,Kvaser就开始CAN产品的研发,在相关产品开发领域有近40多年的经验,对CAN和相关总线技术有着非常深入的研究。广州智维电子科技是KVASER的中国引进者,我们会不定期分享一些有趣的发现和特定情况的技术处理。 在开发严重…

美国过境签证申请也要面签吗?

随着人们出国旅行的增加,美国过境签证成为了一个热门话题。对于许多人来说,了解美国过境签证的流程和要求非常重要。在这篇文章中,知识人网小编将介绍美国过境签证是否需要面签,以及相关的注意事项。 首先,让我们来了解…

Redis7学习笔记01

一、redis7实战教程简洁 1、大纲: ①、适合对象,从小白到熟手,一套全包圆 ②、Redis专题-大厂面试题,含100道 ③、Redis专题-真实需求生产真实案例 ④、Redis7新特性 2、小白篇高阶篇: 3、大厂面试题&#xff1a…

web场景-静态资源规则与定制化

一、SpringBoot默认静态资源路径 1.1 静态资源放在类路径下: /static/public/resources/META-INF/resources 1.2 浏览器访问: 当前项目根路径/ 静态资源名 eg:如上图,要想访问这四张图片,访问路径依次为:localhos…

1400*C. Computer Game

Example input 6 15 5 3 2 15 5 4 3 15 5 2 1 15 5 5 1 16 7 5 2 20 5 7 3 output 4 -1 5 2 0 1 解析: k个电, 第一种为 k>a 时,只玩游戏 k-a; 第二种,k>b,一边玩一边充电 k-b 问完成n轮游戏的情况下,优先第…

被逼无奈在小公司熬了2年,现在我终于进了腾讯测试岗...

其实两年前校招的时候就往腾讯投了一次简历,结果很明显凉了,随后这个理想就被暂时放下了,但是这个种子一直埋在心里,想着总有一天会再次挑战的。 其实这两年除了工作以外,其余时间基本上都在学习,打磨自己…

基于OpenCV solvePnP函数估计头部姿势

人脸识别 文章目录 人脸识别一、姿势估计概述1、概述2、姿态估计3、在数学上表示相机运动4、姿势估计需要什么5、姿势估计算法6、Levenberg-Marquardt 优化 二、solvePnP函数1、函数原型2、参数详解 三、OpenCV源码1、源码路径 四、效果图像示例参考链接 一、姿势估计概述 1、…