分割/目标检测数据集制作工具

1. 安装

1.创建conda虚拟环境

(base) PS C:\Users\13241>conda create -n label python=3.10

输出

Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: C:\Users\13241\miniconda3\envs\label

  added / updated specs:
    - python=3.10


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    openssl-3.0.12             |       h2bbff1b_0         7.4 MB
    pip-23.3.1                 |  py310haa95532_0         2.9 MB
    python-3.10.13             |       he1021f5_0        15.8 MB
    setuptools-68.0.0          |  py310haa95532_0         934 KB
    wheel-0.41.2               |  py310haa95532_0         127 KB
    ------------------------------------------------------------
                                           Total:        27.1 MB

The following NEW packages will be INSTALLED:

  bzip2              pkgs/main/win-64::bzip2-1.0.8-he774522_0
  ca-certificates    pkgs/main/win-64::ca-certificates-2023.08.22-haa95532_0

  libffi             pkgs/main/win-64::libffi-3.4.4-hd77b12b_0
  openssl            pkgs/main/win-64::openssl-3.0.12-h2bbff1b_0
  pip                pkgs/main/win-64::pip-23.3.1-py310haa95532_0
  python             pkgs/main/win-64::python-3.10.13-he1021f5_0
  setuptools         pkgs/main/win-64::setuptools-68.0.0-py310haa95532_0
  sqlite             pkgs/main/win-64::sqlite-3.41.2-h2bbff1b_0
  tk                 pkgs/main/win-64::tk-8.6.12-h2bbff1b_0
  tzdata             pkgs/main/noarch::tzdata-2023c-h04d1e81_0
  vc                 pkgs/main/win-64::vc-14.2-h21ff451_1
  vs2015_runtime     pkgs/main/win-64::vs2015_runtime-14.27.29016-h5e58377_2

  wheel              pkgs/main/win-64::wheel-0.41.2-py310haa95532_0
  xz                 pkgs/main/win-64::xz-5.4.2-h8cc25b3_0
  zlib               pkgs/main/win-64::zlib-1.2.13-h8cc25b3_0


Proceed ([y]/n)? y


Downloading and Extracting Packages

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
#     $ conda activate label
#
# To deactivate an active environment, use
#
#     $ conda deactivate

2.激活label环境

(base) PS C:\Users\13241>conda activate label

3.安装 labelimg库

(label) PS C:\Users\13241>pip install labelimg

输出

Collecting labelimg
  Downloading labelImg-1.8.6.tar.gz (247 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 kB 92.7 kB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting pyqt5 (from labelimg)
  Downloading PyQt5-5.15.10-cp37-abi3-win_amd64.whl.metadata (2.2 kB)
Collecting lxml (from labelimg)
  Downloading lxml-4.9.3-cp310-cp310-win_amd64.whl.metadata (3.9 kB)
Collecting PyQt5-sip<13,>=12.13 (from pyqt5->labelimg)
  Downloading PyQt5_sip-12.13.0-cp310-cp310-win_amd64.whl.metadata (524 bytes)
Collecting PyQt5-Qt5>=5.15.2 (from pyqt5->labelimg)
  Downloading PyQt5_Qt5-5.15.2-py3-none-win_amd64.whl (50.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 50.1/50.1 MB 116.6 kB/s eta 0:00:00
Downloading lxml-4.9.3-cp310-cp310-win_amd64.whl (3.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.8/3.8 MB 157.9 kB/s eta 0:00:00
Downloading PyQt5-5.15.10-cp37-abi3-win_amd64.whl (6.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.8/6.8 MB 221.4 kB/s eta 0:00:00
Downloading PyQt5_sip-12.13.0-cp310-cp310-win_amd64.whl (78 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.5/78.5 kB 174.5 kB/s eta 0:00:00
Building wheels for collected packages: labelimg
  Building wheel for labelimg (setup.py) ... done
  Created wheel for labelimg: filename=labelImg-1.8.6-py2.py3-none-any.whl size=261580 sha256=4c4585c343ff3d4523554f9573ddcc31a4d19434e90d11dc8ad55163e0b179d6
  Stored in directory: c:\users\13241\appdata\local\pip\cache\wheels\d9\f0\1e\74c509495458cad13a0fda23fe605e643177625cf2b5c17b34
Successfully built labelimg
Installing collected packages: PyQt5-Qt5, PyQt5-sip, lxml, pyqt5, labelimg
Successfully installed PyQt5-Qt5-5.15.2 PyQt5-sip-12.13.0 labelimg-1.8.6 lxml-4.9.3 pyqt5-5.15.10

4.使用lambimg

(label) PS C:\Users\13241> lamblimg

5.安装 labelme库

(label) PS C:\Users\13241> pip install labelme

输出

Collecting labelme
  Using cached labelme-5.3.1.tar.gz (1.5 MB)
  Preparing metadata (setup.py) ... done
Collecting gdown (from labelme)
  Using cached gdown-4.7.1-py3-none-any.whl (15 kB)
Collecting imgviz>=0.11 (from labelme)
  Using cached imgviz-1.7.4-py3-none-any.whl.metadata (5.6 kB)
Collecting matplotlib (from labelme)
  Using cached matplotlib-3.8.2-cp310-cp310-win_amd64.whl.metadata (5.9 kB)
Collecting natsort>=7.1.0 (from labelme)
  Using cached natsort-8.4.0-py3-none-any.whl.metadata (21 kB)
Collecting numpy (from labelme)
  Using cached numpy-1.26.2-cp310-cp310-win_amd64.whl.metadata (61 kB)
Collecting onnxruntime>=1.14.1 (from labelme)
  Using cached onnxruntime-1.16.3-cp310-cp310-win_amd64.whl.metadata (4.5 kB)
Collecting Pillow>=2.8 (from labelme)
  Using cached Pillow-10.1.0-cp310-cp310-win_amd64.whl.metadata (9.6 kB)
Collecting PyYAML (from labelme)
  Using cached PyYAML-6.0.1-cp310-cp310-win_amd64.whl.metadata (2.1 kB)
Collecting qtpy!=1.11.2 (from labelme)
  Using cached QtPy-2.4.1-py3-none-any.whl.metadata (12 kB)
Collecting scikit-image (from labelme)
  Using cached scikit_image-0.22.0-cp310-cp310-win_amd64.whl.metadata (13 kB)
Collecting termcolor (from labelme)
  Using cached termcolor-2.3.0-py3-none-any.whl (6.9 kB)
Collecting colorama (from labelme)
  Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Collecting coloredlogs (from onnxruntime>=1.14.1->labelme)
  Using cached coloredlogs-15.0.1-py2.py3-none-any.whl (46 kB)
Collecting flatbuffers (from onnxruntime>=1.14.1->labelme)
  Using cached flatbuffers-23.5.26-py2.py3-none-any.whl.metadata (850 bytes)
Collecting packaging (from onnxruntime>=1.14.1->labelme)
  Using cached packaging-23.2-py3-none-any.whl.metadata (3.2 kB)
Collecting protobuf (from onnxruntime>=1.14.1->labelme)
  Using cached protobuf-4.25.1-cp310-abi3-win_amd64.whl.metadata (541 bytes)
Collecting sympy (from onnxruntime>=1.14.1->labelme)
  Using cached sympy-1.12-py3-none-any.whl (5.7 MB)
Collecting filelock (from gdown->labelme)
  Using cached filelock-3.13.1-py3-none-any.whl.metadata (2.8 kB)
Collecting requests[socks] (from gdown->labelme)
  Using cached requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
Collecting six (from gdown->labelme)
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting tqdm (from gdown->labelme)
  Using cached tqdm-4.66.1-py3-none-any.whl.metadata (57 kB)
Collecting beautifulsoup4 (from gdown->labelme)
  Using cached beautifulsoup4-4.12.2-py3-none-any.whl (142 kB)
Collecting contourpy>=1.0.1 (from matplotlib->labelme)
  Using cached contourpy-1.2.0-cp310-cp310-win_amd64.whl.metadata (5.8 kB)
Collecting cycler>=0.10 (from matplotlib->labelme)
  Using cached cycler-0.12.1-py3-none-any.whl.metadata (3.8 kB)
Collecting fonttools>=4.22.0 (from matplotlib->labelme)
  Using cached fonttools-4.45.1-cp310-cp310-win_amd64.whl.metadata (158 kB)
Collecting kiwisolver>=1.3.1 (from matplotlib->labelme)
  Using cached kiwisolver-1.4.5-cp310-cp310-win_amd64.whl.metadata (6.5 kB)
Collecting pyparsing>=2.3.1 (from matplotlib->labelme)
  Using cached pyparsing-3.1.1-py3-none-any.whl.metadata (5.1 kB)
Collecting python-dateutil>=2.7 (from matplotlib->labelme)
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting scipy>=1.8 (from scikit-image->labelme)
  Using cached scipy-1.11.4-cp310-cp310-win_amd64.whl.metadata (60 kB)
Collecting networkx>=2.8 (from scikit-image->labelme)
  Using cached networkx-3.2.1-py3-none-any.whl.metadata (5.2 kB)
Collecting imageio>=2.27 (from scikit-image->labelme)
  Using cached imageio-2.33.0-py3-none-any.whl.metadata (4.9 kB)
Collecting tifffile>=2022.8.12 (from scikit-image->labelme)
  Using cached tifffile-2023.9.26-py3-none-any.whl.metadata (30 kB)
Collecting lazy_loader>=0.3 (from scikit-image->labelme)
  Using cached lazy_loader-0.3-py3-none-any.whl.metadata (4.3 kB)
Collecting soupsieve>1.2 (from beautifulsoup4->gdown->labelme)
  Using cached soupsieve-2.5-py3-none-any.whl.metadata (4.7 kB)
Collecting humanfriendly>=9.1 (from coloredlogs->onnxruntime>=1.14.1->labelme)
  Using cached humanfriendly-10.0-py2.py3-none-any.whl (86 kB)
Collecting charset-normalizer<4,>=2 (from requests[socks]->gdown->labelme)
  Using cached charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl.metadata (34 kB)
Collecting idna<4,>=2.5 (from requests[socks]->gdown->labelme)
  Using cached idna-3.5-py3-none-any.whl.metadata (9.9 kB)
Collecting urllib3<3,>=1.21.1 (from requests[socks]->gdown->labelme)
  Using cached urllib3-2.1.0-py3-none-any.whl.metadata (6.4 kB)
Collecting certifi>=2017.4.17 (from requests[socks]->gdown->labelme)
  Using cached certifi-2023.11.17-py3-none-any.whl.metadata (2.2 kB)
Collecting PySocks!=1.5.7,>=1.5.6 (from requests[socks]->gdown->labelme)
  Using cached PySocks-1.7.1-py3-none-any.whl (16 kB)
Collecting mpmath>=0.19 (from sympy->onnxruntime>=1.14.1->labelme)
  Using cached mpmath-1.3.0-py3-none-any.whl (536 kB)
Collecting pyreadline3 (from humanfriendly>=9.1->coloredlogs->onnxruntime>=1.14.1->labelme)
  Using cached pyreadline3-3.4.1-py3-none-any.whl (95 kB)
Using cached imgviz-1.7.4-py3-none-any.whl (7.7 MB)
Using cached natsort-8.4.0-py3-none-any.whl (38 kB)
Using cached onnxruntime-1.16.3-cp310-cp310-win_amd64.whl (7.4 MB)
Using cached numpy-1.26.2-cp310-cp310-win_amd64.whl (15.8 MB)
Using cached Pillow-10.1.0-cp310-cp310-win_amd64.whl (2.6 MB)
Using cached QtPy-2.4.1-py3-none-any.whl (93 kB)
Downloading matplotlib-3.8.2-cp310-cp310-win_amd64.whl (7.6 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.6/7.6 MB 31.0 kB/s eta 0:00:00
Downloading PyYAML-6.0.1-cp310-cp310-win_amd64.whl (145 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 145.3/145.3 kB 38.4 kB/s eta 0:00:00
Downloading scikit_image-0.22.0-cp310-cp310-win_amd64.whl (24.5 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 24.5/24.5 MB 36.9 kB/s eta 0:00:00
Downloading contourpy-1.2.0-cp310-cp310-win_amd64.whl (186 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 186.7/186.7 kB 30.1 kB/s eta 0:00:00
Using cached cycler-0.12.1-py3-none-any.whl (8.3 kB)
Downloading fonttools-4.45.1-cp310-cp310-win_amd64.whl (2.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.2/2.2 MB 34.9 kB/s eta 0:00:00
Downloading imageio-2.33.0-py3-none-any.whl (313 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 313.3/313.3 kB 29.5 kB/s eta 0:00:00
Downloading kiwisolver-1.4.5-cp310-cp310-win_amd64.whl (56 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 56.1/56.1 kB 26.2 kB/s eta 0:00:00
Downloading lazy_loader-0.3-py3-none-any.whl (9.1 kB)
Downloading networkx-3.2.1-py3-none-any.whl (1.6 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.6/1.6 MB 30.6 kB/s eta 0:00:00
Using cached packaging-23.2-py3-none-any.whl (53 kB)
Using cached pyparsing-3.1.1-py3-none-any.whl (103 kB)
Downloading scipy-1.11.4-cp310-cp310-win_amd64.whl (44.1 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 44.1/44.1 MB 31.1 kB/s eta 0:00:00
Downloading tifffile-2023.9.26-py3-none-any.whl (222 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 222.9/222.9 kB 23.4 kB/s eta 0:00:00
Using cached filelock-3.13.1-py3-none-any.whl (11 kB)
Downloading flatbuffers-23.5.26-py2.py3-none-any.whl (26 kB)
Downloading protobuf-4.25.1-cp310-abi3-win_amd64.whl (413 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 413.4/413.4 kB 31.7 kB/s eta 0:00:00
Using cached tqdm-4.66.1-py3-none-any.whl (78 kB)
Downloading certifi-2023.11.17-py3-none-any.whl (162 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 162.5/162.5 kB 34.6 kB/s eta 0:00:00
Downloading charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl (100 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100.3/100.3 kB 53.4 kB/s eta 0:00:00
Downloading idna-3.5-py3-none-any.whl (61 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.6/61.6 kB 78.2 kB/s eta 0:00:00
Downloading soupsieve-2.5-py3-none-any.whl (36 kB)
Downloading urllib3-2.1.0-py3-none-any.whl (104 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 104.6/104.6 kB 66.3 kB/s eta 0:00:00
Using cached requests-2.31.0-py3-none-any.whl (62 kB)
Building wheels for collected packages: labelme
  Building wheel for labelme (setup.py) ... done
  Created wheel for labelme: filename=labelme-5.3.1-py3-none-any.whl size=1472284 sha256=fccf779957dea23334cdf3d225e6e5b8b8e41f07d3e01b434f932cc20bd23b82
  Stored in directory: c:\users\13241\appdata\local\pip\cache\wheels\32\d6\4d\f22a84b8a82543c9db037748207ca29ccf8167c3b55a169959
Successfully built labelme
Installing collected packages: pyreadline3, mpmath, flatbuffers, urllib3, termcolor, sympy, soupsieve, six, PyYAML, PySocks, pyparsing, protobuf, Pillow, packaging, numpy, networkx, natsort, lazy_loader, kiwisolver, idna, humanfriendly, fonttools, filelock, cycler, colorama, charset-normalizer, certifi, tqdm, tifffile, scipy, requests, qtpy, python-dateutil, imageio, contourpy, coloredlogs, beautifulsoup4, scikit-image, onnxruntime, matplotlib, imgviz, gdown, labelme
Successfully installed Pillow-10.1.0 PySocks-1.7.1 PyYAML-6.0.1 beautifulsoup4-4.12.2 certifi-2023.11.17 charset-normalizer-3.3.2 colorama-0.4.6 coloredlogs-15.0.1 contourpy-1.2.0 cycler-0.12.1 filelock-3.13.1 flatbuffers-23.5.26 fonttools-4.45.1 gdown-4.7.1 humanfriendly-10.0 idna-3.5 imageio-2.33.0 imgviz-1.7.4 kiwisolver-1.4.5 labelme-5.3.1 lazy_loader-0.3 matplotlib-3.8.2 mpmath-1.3.0 natsort-8.4.0 networkx-3.2.1 numpy-1.26.2 onnxruntime-1.16.3 packaging-23.2 protobuf-4.25.1 pyparsing-3.1.1 pyreadline3-3.4.1 python-dateutil-2.8.2 qtpy-2.4.1 requests-2.31.0 scikit-image-0.22.0 scipy-1.11.4 six-1.16.0 soupsieve-2.5 sympy-1.12 termcolor-2.3.0 tifffile-2023.9.26 tqdm-4.66.1 urllib3-2.1.0

6.使用lambme

(label) PS C:\Users\13241> labelme

输出

[INFO   ] __init__:get_config:70 - Loading config file from: C:\Users\13241\.labelmerc

2. lambimg

2.1 界面

在这里插入图片描述

2.2 使用

在这里插入图片描述
在我们进行标注时,我们可以在Anaconda Prompt中实时查看到标注情况。
在这里插入图片描述
标注完所有图像之后就可以查看标记结果了,注意这里我们进行标注时有两种标记数据的格式一种是PascalVoc,另外一种是YOLO,这里以常见的VOC数据集格式进行标注,最终得到以xml格式的标注数据。
在这里插入图片描述
Voc数据集的数据格式,包含对象名,标记框的基本信息。
在这里插入图片描述
至此,用labelimg制作数据集的过程到此结束,就可以去训练YOLO的模型了。

3. labelme

3.1 界面

在这里插入图片描述

3.2 使用

如图所示,我们可以进行矩形标注、点标注、以及圆形标注等多种格式进行标注,界面的上的按钮的作用和labelimg类似,这里不再赘述。
在这里插入图片描述
相对于labelimg,我们可以以多种形式进行数据标注,如下图:
在这里插入图片描述
标注完后进行保存save,图片上标注的信息将以json文格式将进行保存,如下图:
在这里插入图片描述

4. 总结

labelimg标注完数据之后以.xml数据的格式进行保存,只能创建矩形框更加适用于目标检测制作数据集,如YOLO,而labelme以.json文件的数据格式进行保存,可以创建多种类型的边框进行标注,适用于图像分割,如MaskRcnn。

  • 7
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
COCO分割数据集制作是基于目标检测数据集的,首先需要选择通用的COCO格式数据集进行制作。具体的制作过程可以参考引用中的文章,该文章提供了对COCO目标检测分割数据集格式的介绍,包括标注文件的格式和内容。在制作过程中,可以借助引用提供的完整教程和转换程序代码,跟着操作即可完成数据集制作制作COCO分割数据集的主要步骤包括以下几个方面: 1. 数据采集:收集包含目标物体的图像和相应的标注数据。 2. 数据标注:使用合适的工具对图像进行标注,标注出目标物体的边界和像素级别的分割掩码。 3. 数据转换:将标注数据转换为COCO数据集的格式,包括标注文件和图像文件。 4. 数据拆分:根据需求将数据集划分为训练集、验证集和测试集。 5. 数据预处理:对图像和标注数据进行预处理,如图像大小调整、数据增强等。 6. 数据集管理:组织和管理数据集,确保数据集的质量和完整性。 以上是COCO分割数据集制作的一般步骤,具体的实施方式可以参考引用和引用中的文章,它们提供了详细的操作指导和代码示例,有助于你完成COCO分割数据集制作。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [COCO_02 二值分割数据集制作为COCO数据集](https://blog.csdn.net/qq_44776065/article/details/128697177)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [coco、voc实例分割数据集制作-labelme](https://download.csdn.net/download/weixin_42715977/85981276)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值